Run ID:74874
提交时间:2024-05-26 11:04:09
#include<bits/stdc++.h> using namespace std; int main() { int a,b,c; cin >> a >> b >> c; if(a % b == 0) { cout << "Divided by zero!"; } if(c == +) { cout << a + b; return 0; } if(c == /) { cout << a / b; return 0; } if(c == *) { cout << a * b; return 0; } if(c == -) { cout << a - b; }else{ cout << "Invalid operator!" } return 0; }