ccf-201909-1小明种苹果
作者:互联网
#include <iostream>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
int t=0,k=0,p=0,max=0;
int a[n][m+1];
for(int i=0;i<n;i++)
for(int j=0;j<m+1;j++)
cin>>a[i][j];
for(int i=0;i<n;i++)
{
int count=0;
for(int j=1;j<=m;j++)
{
count+=a[i][j];
}
if(count<max)
{
max=count;
k=i+1;
p=-count;
}
t+=a[i][0]+count;
}
cout<<t<<' '<<k<<' '<<p<<endl;
return 0;
}
标签:std,main,小明种,int,max,include,ccf,201909 来源: https://blog.csdn.net/qq_57930511/article/details/120260026