Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
100256 | 谭思宸 | 12序列的第n项 | C++ | Compile Error | 0 MS | 0 KB | 199 | 2024-12-07 12:11:46 |
#include<iostream> using namespace std; int main(){ int n;ans=1; cin>>n; for(int j=0;j<n-1;j++) ans+=j; cout<<ans=n<<endl; return 0; }
Main.cc: In function 'int main()': Main.cc:4:15: error: 'ans' was not declared in this scope int n;ans=1; ^ Main.cc:8:22: error: invalid operands of types 'int' and '' to binary 'operator<<' cout<