2 solutions

  • 2
    @ 2024-4-1 11:22:26

    #include

    using namespace std;

    int a[105][105]; int b[105][105]; int n,m;

    int main(){ cin >> n >> m; //读入行和列 for (int i=1;i<=n;i++) for (int j=1;j<=m;j++) //i行j列 cin >> a[i][j]; for (int i=1;i<=n;i++) for (int j=1;j<=m;j++) //i行j列 cin >> b[i][j];

    for (int i=1;i<=n;i++){
    	for (int j=1;j<=m;j++)	//i行j列
    		cout << a[i][j] + b[i][j] << " "; 
    	cout << endl;		
    }
    

    Copy

    }

    • 1
      @ 2024-4-1 11:17:51

      #include

      using namespace std;

      int a[105][105]; int b[105][105]; int n,m;

      int main(){ cin >> n >> m; //读入行和列 for (int i=1;i<=n;i++) for (int j=1;j<=m;j++) //i行j列 cin >> a[i][j]; for (int i=1;i<=n;i++) for (int j=1;j<=m;j++) //i行j列 cin >> b[i][j];

      for (int i=1;i<=n;i++){
      	for (int j=1;j<=m;j++)	//i行j列
      		cout << a[i][j] + b[i][j] << " "; 
      	cout << endl;		
      }
      

      }

      • 1

      Information

      ID
      6919
      Time
      1000ms
      Memory
      128MiB
      Difficulty
      1
      Tags
      # Submissions
      77
      Accepted
      47
      Uploaded By