| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 139150 | 王奕杰 | 数组中元素交换 | C++ | Compile Error | 0 MS | 0 KB | 990 | 2025-12-01 19:06:54 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,a[100],t; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n-1;i+=2){ t=a[i]; a[i]=a[i+1]; a[i+1]=t; } for(int i=0;i<n;i++){ cout<<a[i]<<" "; } return 0; }#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,a[100],t; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n-1;i+=2){ t=a[i]; a[i]=a[i+1]; a[i+1]=t; } for(int i=0;i<n;i++){ cout<<a[i]<<" "; } return 0; }
Main.cc:25:2: error: stray '#' in program
}#include // cin\cout\endl
^
Main.cc:25:3: error: 'include' does not name a type
}#include // cin\cout\endl
^
Main.cc: In function 'int main()':
Main.cc:31:5: error: redefinition of 'int main()'
int main(){
^
Main.cc:7:5: note: 'int main()' previously defined here
int main(){
^