有十人学生,每个学生的数据包括学号,姓名,3门课的成绩,从键盘输入10个学生的数据,要求打印3门课的总的平均成绩;
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 1000000
using namespace std;
int main(){
double resa,resb,resc;
char aa[100],bb[100];
double a,b,c;
for(int i=0; i<10; ++i){
cout<<"please input " <<i+1<<"th data:"<<endl;
cin>>aa>>bb>>a>>b>>c;
resa += a;
resb += b;
resc += c;
}
printf("first class: %.2lf\n",resa/10);
printf("second class: %.2lf\n",resb/10);
printf("third class: %.2lf\n",resc/10);
return 0;
}