Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
127793 张永良 矩阵转置 C++ Compile Error 0 MS 0 KB 303 2025-07-29 13:21:50

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ cin>>n>>m; int a[n+1][m+1]; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin>>a[j][i]; } } for(int i=0;i<m;i++){ for(int j=0;j<n;j++){ cout<<a[i][j]<<" "; }cout<<endl; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:4:6: error: 'n' was not declared in this scope
 cin>>n>>m;
      ^
Main.cc:4:9: error: 'm' was not declared in this scope
 cin>>n>>m;
         ^
Main.cc:8:13: error: 'a' was not declared in this scope
        cin>>a[j][i]; 
             ^
Main.cc:13:14: error: 'a' was not declared in this scope
        cout<