6 条题解

  • 0
    @ 2024-6-7 17:43:40

    #include<bits/stdc++.h> using namespace std; int a[105][105],b[105][105],c[105][105]; int main(){ int n,m; cin>>n>>m; for(int i = 1;i<=n;i++){ for(int j = 1;j<=m;j++){ cin>>a[i][j]; }

    }
    for(int i = 1;i<=n;i++){
    	for(int j = 1;j<=m;j++){
    		cin>>b[i][j];
    	}
    }
    for(int i = 1;i<=n;i++){
    	for(int j = 1;j<=m;j++){
    		c[i][j] = a[i][j]+b[i][j];
    		cout<<c[i][j]<<" ";
    	}
    	cout<<endl;
    }
    
    return 0;
    

    }

    • @ 2024-6-7 17:45:52

      #include<bits/stdc++.h> using namespace std; int a[105][105],b[105][105],c[105][105]; int main(){ int n,m; cin>>n>>m; for(int i = 1;i<=n;i++){ for(int j = 1;j<=m;j++){ cin>>a[i][j]; }

      }
      for(int i = 1;i<=n;i++){
      	for(int j = 1;j<=m;j++){
      		cin>>b[i][j];
      	}
      }
      for(int i = 1;i<=n;i++){
      	for(int j = 1;j<=m;j++){
      		c[i][j] = a[i][j]+b[i][j];
      		cout<<c[i][j]<<" ";
      	}
      	cout<<endl;
      }
      
      return 0;
      

      }

信息

ID
154
时间
1000ms
内存
128MiB
难度
4
标签
(无)
递交数
280
已通过
126
上传者