Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5844 李伟和 二维数组输出(2) C++ Accepted 8 MS 268 KB 301 2024-12-18 18:14:28

Tests(3/3):


Code:

#include <iostream> using namespace std; int main() { int n; int a[10][10]; cin>>n; int value=1; for(int j=0;j<n;j++){ for(int i=0;i<n;i++){ a[i][j]=value++; } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cout<<a[i][j]<<" "; } cout<<endl; } return 0; }