Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
125703 陈华仁星 矩阵右移动 C++ Compile Error 0 MS 0 KB 477 2025-07-15 11:52:55

Tests(0/0):


Code:

#include <iostream> #include <algorithm> using namespace std; int a[100][100],b[100][100]; int main() { int n,m,num=0,k; scanf("%d%d",&m,&n); for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { scanf("%d",&a[i][j]); } } for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { k=(j+m)%3; b[i][k]=a[i][j]; } } for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { printf("%d ",b[i][j]); } cout << endl } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:31:2: error: expected ';' before '}' token
  }
  ^
Main.cc:7:10: warning: unused variable 'num' [-Wunused-variable]
  int n,m,num=0,k;
          ^
Main.cc:8:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&m,&n);
                     ^
Main.cc:13:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&a[i][j]);
                        ^