fork download
  1. int main() {
  2. char i;
  3. int fl=0,ff=0,fq=0;
  4. cin >> i;
  5. while(i!= '\n' && i!=EOF){
  6. cout << i << endl;
  7. if(i=='f') {
  8. cin >> i;
  9. switch (i) {
  10. case('l'):
  11. ++fl;
  12. break;
  13. case('f'):
  14. ++ff;
  15. break;
  16. case('q'):
  17. ++fq;
  18. break;
  19.  
  20. }
  21. } else
  22. cin >> i;
  23. }
  24. cout << "fl: " << fl << endl;
  25. cout << "ff: " << ff << endl;
  26. cout << "fq: " << fq << endl;
  27.  
  28. return 0;
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:4:5: error: ‘cin’ was not declared in this scope
     cin >> i;
     ^~~
prog.cpp:5:26: error: ‘EOF’ was not declared in this scope
     while(i!= '\n' && i!=EOF){
                          ^~~
prog.cpp:6:9: error: ‘cout’ was not declared in this scope
         cout << i << endl;
         ^~~~
prog.cpp:6:22: error: ‘endl’ was not declared in this scope
         cout << i << endl;
                      ^~~~
prog.cpp:24:5: error: ‘cout’ was not declared in this scope
     cout << "fl: " << fl << endl;
     ^~~~
prog.cpp:24:29: error: ‘endl’ was not declared in this scope
     cout << "fl: " << fl << endl;
                             ^~~~
stdout
Standard output is empty