fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int topi=-1;
  4. char ch2[100001];
  5. char top()
  6. {
  7. return ch2[topi];
  8. }
  9.  
  10. char* push(char a)
  11. {
  12. ch2[++topi] = a;
  13. }
  14.  
  15. void pop()
  16. {
  17. topi--;
  18. }
  19.  
  20.  
  21. int main()
  22. {
  23. int a,b,c,d,e,f,g,h,i,j;
  24. cin>>a;g=0;char z;char ch[100001];
  25. for(b=0;b<a;b++)
  26. {
  27. fflush(stdin);
  28. gets(ch);
  29. c = strlen(ch);
  30. ch[c] = '\0';topi=-1;
  31. for(d=0;d<c;d++)
  32. {
  33. if(d==0)
  34. {
  35. push(ch[d]);
  36. }
  37. else{
  38. if(topi!=-1 && top()==ch[d])
  39. {
  40. e++;
  41. pop();
  42. }
  43. else{
  44. push(ch[d]);
  45. }
  46. }}
  47.  
  48. if(topi==-1)
  49. g++;
  50. else{}
  51. }
  52. cout<<g<<"\n";
  53. }
  54.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:28:16: error: ‘gets’ was not declared in this scope
         gets(ch);
                ^
stdout
Standard output is empty