为什么只有90分,root ? ? ?

wc040 2024-12-03 22:18:18 2024-12-04 21:33:26 6

#include #include using namespace std; int main() { int a,b; char c; cin >> a >> b >> c; if (c == '+') {cout << a + b;} else if (c == '-') {cout << a - b;} else if (c == '*') {cout << a * b;} else if (c == '/') {cout <<a/b;} else if (b == 0) {cout << "Divided by zero!";} else cout << "Invalid operator!"; return 0; }

{{ vote && vote.total.up }}

共 1 条回复

root 站长

正常的除法呢