首页上一页 1 下一页尾页 1 条记录 1/1页
#include<iostream>
using namespace std;
int main()
{
int i,num;
int chinese[50],math[50],english[50];
int studentid[50];
double ave[50];
double sum[50];
cout<<"请输入学生人数:"<<endl;
cin>>num;
cout<<"studentid chinese math english"<<endl;
for(i=0;i<num;i++)
{
cout<<"N0.1"<<i+1;
cin>>studentid[i]>>chinses[i]>>math[i]>>english[i]>>endl;
sum[i]=(double)(chinese[i]+math[i]+english[i]);
ave[i]=sum[i]/3;
}
for(i=0;i<num;i++)
{
cout<<studentid[i]<<" "<<chinese[i]<<" "<<math[i]<<" "<<english[i]<<" "<<ave[i]<<" "<<sum[i]<<endl;
}
return 0;
}