Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <fstream>
  2. #include <cstring>
  3. using namespace std;
  4. ifstream fin("paranteze2.in");
  5. ofstream fout("paranteze2.out");
  6. int vf, x, n, i, j, nr, d, maxi;
  7. char a[280];
  8. int main()
  9. {
  10. fin>>a;
  11. d=strlen(a);
  12. while(j<d){
  13. if(a[j]=='(')
  14. nr++;
  15.  
  16. else
  17. nr--;
  18.  
  19. if(maxi<nr)
  20. maxi=nr;
  21.  
  22. j++;
  23. }
  24.  
  25.  
  26.  
  27. g<<maxi;
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement