fork download
  1. #include <iostream>
  2. #include <stack>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main() {
  7. stack <char> st;
  8. char c;
  9. int ch=0;
  10. while( cin>>c ){
  11. if(st.emoty())st.push(c);
  12. else if (c==st.top()){
  13. st.pop();
  14. ch++;
  15. }
  16. else st.push(c);
  17. }
  18. if (ch=2) cout << ("Yes")
  19. else cout << ("No")
  20. return 0>
  21.  
  22. }
  23.  
  24. return 0;
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:11:9: error: ‘class std::stack<char>’ has no member named ‘emoty’; did you mean ‘empty’?
   if(st.emoty())st.push(c);
         ^~~~~
prog.cpp:19:2: error: expected ‘;’ before ‘else’
  else cout << ("No")
  ^~~~
prog.cpp: At global scope:
prog.cpp:24:2: error: expected unqualified-id before ‘return’
  return 0;
  ^~~~~~
prog.cpp:25:1: error: expected declaration before ‘}’ token
 }
 ^
stdout
Standard output is empty