Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6767 张育斌 蛇形矩阵 C++ Wrong Answer 0 MS 264 KB 758 2025-03-15 14:39:03

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<bits/stdc++.h> #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,a[11][11]; cin>>n; int t=1; for(int j=1;j<=n;j++){ if(j%2==1){ for(int i;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; } } return 0; }


Run Info:

------Input------
1
------Answer-----
1
------Your output-----