Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6496 张育斌 矩阵行交换 C++ Compile Error 0 MS 0 KB 414 2025-03-01 15:09:25

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int n,m,a[6][6]; cin>>n>>m; for(int i=0;i<5;i++){ for(int j=0;j<5;j++){ cin>>a[i][j]; } } for(int j=0;j<5;j++){ swap(a[n][i],a[m][i]); } for(int i=0;i<5;i++){ for(int j=0;j<5;j++){ cout<<a[i][j]" "; cout<<endl; } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:23: error: 'i' was not declared in this scope
             swap(a[n][i],a[m][i]);
                       ^
Main.cc:16:26: error: expected ';' before string constant
             cout<a[i][j]" ";
                          ^