| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157197 | 余建成 | 蛇形矩阵 | C++ | Compile Error | 0 MS | 0 KB | 357 | 2026-07-20 14:32:42 |
#include<iostream> using namespace std; int main(){ int i,a[11][11]={},n,m=1,c=0; cin>>n; for(i=0;i<n;i++){ if(i%2==1){ for(int j=n-1;j>=0;j--){ a[j][i]=m++; } else{ for(int j=0;j<n;j++) a[j][i]=m++; } } } for(i=0;i<n;i++){ for(int j=0;j<n;j++){ print("%3d",a[i][j]); } cout<<endl; } return 0; }
Main.cc: In function 'int main()':
Main.cc:11:4: error: expected '}' before 'else'
else{
^
Main.cc:4:27: warning: unused variable 'c' [-Wunused-variable]
int i,a[11][11]={},n,m=1,c=0;
^
Main.cc: At global scope:
Main.cc:16:2: error: expected unqualified-id before 'for'
for(i=0;i