1 solutions

  • 0
    @ 2024-10-13 10:52:17

    #include <stdio.h> int main() { int n,m,i,t; int sum=0; scanf("%d %d",&m,&n); int a[m][n]; for(i=0;i<m;i++){ for(t=0;t<n;t++){ scanf("%d ",&a[i][t]); } } for(i=0;i<m;i++){ sum=sum+a[i][0]+a[i][n-1]; } for(i=1;i<n-1;i++){ sum=sum+a[0][i]+a[m-1][i]; } printf("%d",sum); return 0; }

    • 1

    Information

    ID
    6779
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    2
    Tags
    (None)
    # Submissions
    47
    Accepted
    29
    Uploaded By