程式碼如下:
#include<stdio.h>
int num(int c[],int d[],int s);
int main(){
int n,m,i,j,t,sum;
scanf("%d %d",&n,&m);
int a[n],b[n];
for(i=0;i<n;i++,sum=0){
scanf("%d",&a[i]);
for(j=0,sum=0;j<m;j++){
scanf("%d",&t);
sum=sum+t;
}
b[i]=sum;
}
num(a,b,n);
return 0;
}
int num(int c[],int d[],int s){
int sum,i,j;
for(i=0,sum=0;i<s;i++)
sum=sum+c[i]+d[i];
printf("%d ",sum);
for(i=0,j=0;i<s-1;i++)
if(d[j]>d[i+1])
j=i+1;
printf("%d %d",j+1,-d[j]);
}