| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 139271 | 向睿杰 | 09输出成绩等级 | C++ | Compile Error | 0 MS | 0 KB | 273 | 2025-12-06 11:48:25 |
#include<iostream> using namespace stdi; int main() { int score; cin>>score; if(score>='90'){ cout<<"A"<<endl; else if('80'<=score<'90') cout<<"B"<<endl; else if('60'<=score<'70') cout<<"C"<<endl; else cout<<"D"<<endl; } return 0; }
Main.cc:7:12: warning: multi-character character constant [-Wmultichar]
if(score>='90'){
^
Main.cc:9:10: warning: multi-character character constant [-Wmultichar]
else if('80'<=score<'90')
^
Main.cc:9:22: warning: multi-character character constant [-Wmultichar]
else if('80'<=score<'90')
^
Main.cc:11:10: warning: multi-character character constant [-Wmultichar]
else if('60'<=score<'70')
^
Main.cc:11:22: warning: multi-character character constant [-Wmultichar]
else if('60'<=score<'70')
^
Main.cc:2:17: error: 'stdi' is not a namespace-name
using namespace stdi;
^
Main.cc:2:21: error: expected namespace-name before ';' token
using namespace stdi;
^
Main.cc: In function 'int main()':
Main.cc:6:2: error: 'cin' was not declared in this scope
cin>>score;
^
Main.cc:6:2: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:60:18: note: 'std::cin'
extern istream cin; /// Linked to standard input
^
Main.cc:8:3: error: 'cout' was not declared in this scope
cout<<"A"<& __os)
^
Main.cc:9:2: error: expected '}' before 'else'
else if('80'<=score<'90')
^
Main.cc:9:21: warning: comparison of constant '14640' with boolean expression is always true [-Wbool-compare]
else if('80'<=score<'90')
^
Main.cc:9:14: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses]
else if('80'<=score<'90')
^
Main.cc:10:6: error: 'cout' was not declared in this scope
cout<<"B"<& __os)
^
Main.cc:11:21: warning: comparison of constant '14128' with boolean expression is always true [-Wbool-compare]
else if('60'<=score<'70')
^
Main.cc:11:14: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses]
else if('60'<=score<'70')
^
Main.cc:12:6: error: 'cout' was not declared in this scope
cout<<"C"<& __os)
^
Main.cc:14:6: error: 'cout' was not declared in this scope
cout<<"D"<& __os)
^
Main.cc: At global scope:
Main.cc:16:2: error: expected unqualified-id before 'return'
return 0;
^
Main.cc:17:1: error: expected declaration before '}' token
}
^