daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top