3 solutions

  • 1
    @ 2026-10-18 11:41:07
    #include<bits/stdc++.h>
    using namespace std;
    double a[110][110];
    double b[110][110];
    double c[110][110];
    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];
            }
        }
        for(int i=1;i<=n;i++){
            for(int j=1;j<=m;j++){
                cout<<c[i][j]<<' ';
            }
            cout<<endl;
        }
    
    	return 0;
    }
    

    Information

    ID
    908
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    104
    Accepted
    55
    Uploaded By