1 solutions
-
0
#include <bits/stdc++.h> using namespace std;
int main() { int a, b; char c; cin >> a >> b >> c; switch (c) { case '+': cout << a + b; break; case '-': cout << a - b; break; case '*': cout << a *b; break; case '/': if (b == 0) { cout << "Divided by zero!"; } else { cout << a / b; } break; default :cout<<"Invalid operator!"; } return 0; }
- 1
Information
- ID
- 158
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- 4
- Tags
- # Submissions
- 104
- Accepted
- 52
- Uploaded By