| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 149768 | ztx | 简单的分支结构 | C++ | Compile Error | 0 MS | 0 KB | 188 | 2026-03-16 17:04:23 |
#include <iostream> using namespace std; int main(){ int x; cin>>x; if(x>0){ cout<<"1"} } else if(x<0){ cout<<"-1"} } else{ cout<<"0"; } }
Main.cc:1:21: warning: extra tokens at end of #include directive
#include using namespace std;
^
Main.cc: In function 'int main()':
Main.cc:3:12: error: 'cin' was not declared in this scope
cin>>x;
^
Main.cc:3:12: 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:4:21: error: 'cout' was not declared in this scope
if(x>0){ cout<<"1"}
^
Main.cc:4:21: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:61:18: note: 'std::cout'
extern ostream cout; /// Linked to standard output
^
Main.cc: At global scope:
Main.cc:6:1: error: expected unqualified-id before 'else'
else if(x<0){ cout<<"-1"}
^
Main.cc:7:1: error: expected declaration before '}' token
}
^