Advertisement
a53

paranteze4

a53
Jun 16th, 2021
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int Stiva[1000],nrS=0;
  4.  
  5. int main()
  6. {
  7. char S[256];
  8. cin>>S;
  9. int cnt=0;
  10. for(int i=0;S[i];++i)
  11. if(S[i]=='(')
  12. Stiva[++nrS]=++cnt;
  13. else
  14. cout<<Stiva[nrS]<<' ',--nrS;
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement