0
已解决
夏义博
初级守护
初级守护
#include<bits/stdc++.h>
using namespace std;
int a[1001];
int main()
{
int s,d,f,g,h,j,n;
double z=0,x=0,c=0,v=0,b=0,m=0;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i]>>s>>d>>f>>g>>h>>j;
cout<<a[i]<<" "<<s<<" "<<d<<" "<<f<<" "<<g<<" "<<h<<" "<<j<<" ";
cout<<s+d+f+g+h+j<<endl;
}
for(int i=1;i<=n;i++)
{
z=(s*i)/n;
x=(d*i)/n;
c=(f*i)/n;
v=(g*i)/n;
//3
//1 67 89 93 82 87 90
//2 80 98 87 82 89 93
//3 78 86 92 90 67 85
b=(h*i)/n;
m=(j*i)/n;
}
printf("%.1f",z);
cout<<" ";
printf("%.1f",x);
cout<<" ";
printf("%.1f",c);
cout<<" ";
printf("%.1f",v);
cout<<" ";
printf("%.1f",b);
cout<<" ";
printf("%.1f",m);
return 0;
}