Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
3320 季洁 二维数组输出(1) C++ Accepted 100 0 MS 252 KB 273 2019-12-15 19:06:56

Tests(3/3):


#include<iostream> using namespace std; int main(){ int n,l=1,p=1; cin>>n; int a[n][n]; for(int i=0;i<=n-1;i++){ for(int j=0;j<=n-1;j++,l++,p++){ a[i][j]=l; printf("%d ",a[i][j]); if(p==n){ printf("\n"); p=0; } } } return 0; }


Judgement Protocol: