fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int32_t a,b;
  7. char c;
  8. while (cin>>c>>a>>b)
  9. {
  10. switch (c)
  11. {
  12. case '+':
  13. cout<<a+b<<endl;
  14. break;
  15. case '-':
  16. cout<<a-b<<endl;
  17. break;
  18. case '*':
  19. cout<<a*b<<endl;
  20. break;
  21. case '/':
  22. {
  23. if (b!=0)
  24. cout<<a/b<<endl;
  25. }
  26. break;
  27. case '%':
  28. cout<<a%b<<endl;
  29. break;
  30. }
  31. }
  32.  
  33.  
  34. return 0;
  35. }
  36.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:6:5: error: 'int32_t' was not declared in this scope
     int32_t a,b;
     ^
prog.cpp:8:20: error: 'a' was not declared in this scope
     while (cin>>c>>a>>b)
                    ^
prog.cpp:8:23: error: 'b' was not declared in this scope
     while (cin>>c>>a>>b)
                       ^
stdout
Standard output is empty