| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 119309 | 金昱帆 | 13求1+2-3+4-5+……n的值 | C++ | Compile Error | 0 MS | 0 KB | 247 | 2025-05-17 13:07:52 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; int a=1; cin>>n; for(int i=2;i<=n;i++){ if(i%2==0){ a=a+i; } else{ a=a-i; } } cout<<a; return 0
Main.cc: In function 'int main()':
Main.cc:14:12: error: expected ';' at end of input
return 0
^
Main.cc:14:12: error: expected '}' at end of input