题目来源:CSP认证 201909-1 小明种苹果
代码如下:
#include<iostream>
#include<stdio.h>
#include<cstring>
int main()
{
int a[1005],n,m,c,sum=0,max=-1,k;
memset(a,0,sizeof(a));
scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++){
scanf("%d",&c);
sum+=c;
for(int j=0;j<m;j++){
scanf("%d",&c);
sum+=c;
a[i]-=c;
}
if(max<a[i]){
max=a[i];
k=i;
}
}
printf("%d %d %d",sum,k,a[k]);
return 0;
}
来源:CSDN
作者:是羽白啊
链接:https://blog.csdn.net/qq_45695839/article/details/104156860