20分求助
查看原帖
20分求助
1385791
fushuoting楼主2024/11/23 11:56
#include<iostream>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    int a[101][101]={0};
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            cin>>a[i][j];
        }
    }
    int tot=0;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            if(i==1||j==1)
            {
                tot+=a[i][j];
            }
        }
    }
    cout<<tot;
    return 0;
}
2024/11/23 11:56
加载中...