| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 74875 | 胡盛哲 | 03字符转ASCLL码 | C++ | Compile Error | 0 MS | 0 KB | 392 | 2024-05-26 11:06:01 |
#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; }
Main.cc: In function 'int main()':
Main.cc:9:11: error: expected primary-expression before ')' token
if(c == +) {
^
Main.cc:13:10: error: expected primary-expression before '/' token
if(c == /) {
^
Main.cc:13:11: error: expected primary-expression before ')' token
if(c == /) {
^
Main.cc:17:11: error: expected primary-expression before ')' token
if(c == *) {
^
Main.cc:21:11: error: expected primary-expression before ')' token
if(c == -) {
^
Main.cc:25:2: error: expected ';' before '}' token
}
^