Advertisement
haufont

Untitled

Aug 22nd, 2016
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include<iostream>
  2. #include<set>
  3. #include<vector>
  4. #include<algorithm>
  5. #include<set>
  6. #include<vector>
  7. #include<string>
  8. #include<stdlib.h>
  9. #include<math.h>
  10. #include<stdio.h>
  11. using namespace std;
  12.  
  13. void probel(int x)
  14. {
  15. for (int i = 0; i < x; i++)
  16. {
  17. cout << " ";
  18. }
  19. }
  20. int main()
  21. {
  22. string a;
  23. cin >> a;
  24. int q = 0;
  25. int i = 0;
  26. while (i != a.size())
  27. {
  28. string block;
  29. if (a[i] == '<')
  30. {
  31. block += a[i];
  32. i++;
  33. while (a[i] != '>')
  34. {
  35. block += a[i];
  36. i++;
  37. }
  38. }
  39. if (block.size() == 3)
  40. {
  41. probel(q);
  42. cout << block << endl;
  43. q += 2;
  44. }
  45. else
  46. {
  47. q -= 2;
  48. probel(q);
  49. cout << block << endl;
  50. }
  51. i++;
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement