哪位高手给看看呗,编译没问题的。
#include<stdio.h>struct stu
{
float Eng1R[2];
float Eng1L[2];
float Gaoshu1[2];
float Xiandai[2];
float Huafajh[2];
float Lishi[2];
float Sixiu[2];
float Tiyu1[2];
float Tiyu2[2];
float Vb[2];
float Eng2R[2];
float Eng2L[2];
float Gaoshu2[2];
float Gailv[2];
float CAD[2];
float Jsj[2];
float Ziran[2];
float Junshi[2];
float Wuli[2];
}p[40];
void fun1()
{
static int i=0;
char name[12];
float result[40];
printf("Enter the name:\n");
scanf("%s",name);
result[i]=(p[i].Eng1R[0]*p[i].Eng1R[1]+p[i].Eng1L[0]*p[i].Eng1L[1]+p[i].Gaoshu1[0]*p[i].Gaoshu1[1]+p[i].Xiandai[0]*p[i].Xiandai[1]+
p[i].Huafajh[0]*p[i].Huafajh[1] +p[i].Lishi[0]*p[i].Lishi[1]+p[i].Sixiu[0]*p[i].Sixiu[1]+p[i].Tiyu1[0]*p[i].Tiyu1[1]+
p[i].Tiyu2[0]*p[i].Tiyu2[1]+p[i].Vb[0]*p[i].Vb[1]+p[i].Eng2R[0]*p[i].Eng2R[1]+p[i].Eng2L[0]*p[i].Eng2L[1]+
p[i].Gaoshu2[0]*p[i].Gaoshu2[1]+p[i].Gailv[0]*p[i].Gailv[1]+p[i].CAD[0]*p[i].CAD[1]+p[i].Jsj[0]*p[i].Jsj[1]+
p[i].Ziran[0]*p[i].Ziran[1]+p[i].Junshi[0]*p[i].Junshi[1]+p[i].Wuli[0]*p[i].Wuli[1])/52;
printf("The baby's %s scor is: %f\n",name[i],result[i]);
}
main()
{
int i;
printf("\nPlease input the data!:\n");
for(i=0;i<2;i++)
{
printf("英语读写1:\n");
scanf("%f,%f",&(p[i].Eng1R[0]),&(p[i].Eng1R[1]));
printf("英语听说1:\n");
scanf("%f,%f",&(p[i].Eng1L[0]),&(p[i].Eng1L[1]));
printf("高数1:\n");
scanf("%f,%f",&(p[i].Gaoshu1[0]),&(p[i].Gaoshu1[1]));
printf("线代:\n");
scanf("%f,%f",&(p[i].Xiandai[0]),&(p[i].Xiandai[1]));
printf("画法几何:\n");
scanf("%f,%f",&(p[i].Huafajh[0]),&(p[i].Huafajh[1]));
printf("历史:\n");
scanf("%f,%f",&(p[i].Lishi[0]),&(p[i].Lishi[1]));
printf("思修:\n");
scanf("%f,%f",&(p[i].Sixiu[0]),&(p[i].Sixiu[1]));
printf("体育1:\n");
scanf("%f,%f",&(p[i].Tiyu1[0]),&(p[i].Tiyu1[1]));
printf("体育2:\n");
scanf("%f,%f",&(p[i].Tiyu2[0]),&(p[i].Tiyu2[1]));
printf("Vb:\n");
scanf("%f,%f",&(p[i].Vb[0]),&(p[i].Vb[1]));
//scanf("%f,%f",&(p[i].Eng1R[0]),&(p[i].Eng1R[1]));
printf("英语读写2:\n");
scanf("%f,%f",&(p[i].Eng2R[0]),&(p[i].Eng2R[1]));
printf("英语听说2:\n");
scanf("%f,%f",&(p[i].Eng2L[0]),&(p[i].Eng2L[1]));
printf("高数2:\n");
scanf("%f,%f",&(p[i].Gaoshu2[0]),&(p[i].Gaoshu2[1]));
printf("概率:\n");
scanf("%f,%f",&(p[i].Gailv[0]),&(p[i].Gailv[1]));
printf("CAD:\n");
scanf("%f,%f",&(p[i].CAD[0]),&(p[i].CAD[1]));
printf("计算机基础:\n");
scanf("%f,%f",&(p[i].Jsj[0]),&(p[i].Jsj[1]));
printf("自然地理:\n");
scanf("%f,%f",&(p[i].Ziran[0]),&(p[i].Ziran[1]));
printf("军事理论:\n");
scanf("%f,%f",&(p[i].Junshi[0]),&(p[i].Junshi[1]));
printf("大学物理:\n");
scanf("%f,%f",&(p[i].Wuli[0]),&(p[i].Wuli[1]));
fun1();
}
}