Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <cstring>
- using namespace std;
- ifstream fin("paranteze2.in");
- ofstream fout("paranteze2.out");
- int vf, x, n, i, j, nr, d, maxi;
- char a[280];
- int main()
- {
- fin>>a;
- d=strlen(a);
- while(j<d){
- if(a[j]=='(')
- nr++;
- else
- nr--;
- if(maxi<nr)
- maxi=nr;
- j++;
- }
- g<<maxi;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement