Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6766 柯宇希 蛇形矩阵 C++ Compile Error 0 MS 0 KB 755 2025-03-15 14:36:06

Tests(0/0):


Code:

#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 a[11][11],n,t=1; cin>>n; for(int j=1;j<=n;j++){ if(j%2==1){ for(int i=1;i<=n;i++){ a[i][j]==t; t++; } } else{ for(int i=n;i>=1;i--){ a[i][j]==t; t++; } } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ cout<<setw(3)<<endl; if(j==n) cout<<" "; } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:20: warning: statement has no effect [-Wunused-value]
             a[i][j]==t;
                    ^
Main.cc:19:24: warning: statement has no effect [-Wunused-value]
                 a[i][j]==t;
                        ^
Main.cc:26:25: error: 'setw' was not declared in this scope
             cout<setw(3)<<endl;
                         ^