Guest User

Untitled

a guest
Jul 15th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. void wer( string s1, string *s2, int &i, int &t)
  2. {
  3. if( s1[i] == '{')
  4. {
  5. for( i; i !='}'; i++)
  6. {
  7. wer(s1,s2,i,t);
  8. s2[t]=s2[t]+s1[i];
  9. }
  10. s2[t]=s2[t]+s1[i];
  11. i++;
  12. return;
  13. }
  14. return;
  15. }
  16.  
  17. void a(string s1, string *s2, int len, int& s2_sch)
  18. {
  19. int t=0,q=0;
  20. for(int i= 1; i<len; ++i)
  21. if(s1[i] == '}') q++;
  22. else{
  23. if(s1[i] =='{')
  24. {
  25.  
  26. for(i; s1[i] != '}'; i++)
  27. {
  28. wer(s1, s2, i,t);
  29. if( s1[i] != '}')
  30. s2[t]=s2[t]+s1[i];
  31. i++;
  32. }
  33. }
  34.  
  35. if(s1[i] == ',')
  36. {
  37. t++;
  38. s2_sch++;
  39. }
  40. else
  41. s2[t] = s2[t]+s1[i];
  42. }
  43.  
  44. }
Add Comment
Please, Sign In to add comment