求大神指导了,这个程序问题出在哪里
程序代码:
[local]2[/local]#include<stdio.h> #include<stdlib.h> #define PR printf #define SC scanf #define SIZE 3 struct student { char name[10]; long id; int chinese; int match; }stu[3]={{"liang",1273,89,90},{"zhang",1277,91,80},{"pang",1268,85,89}}; //求每个学生和没门课的平均成绩 void average_one() { int i,ave; int sum=0; int shu=0; for(i=0;i<SIZE;i++) { sum=sum+stu[i].chinese; } PR("语文的总分是:%d\n",sum); PR("语文的平均分是:%d\n",sum/3); for(i=0;i<SIZE;i++) { shu=shu+stu[i].match; } PR("数学的总分是:%d\n",shu); PR("数学的平均分是:%d\n",shu/3); for(i=0;i<SIZE;i++) { ave=(stu[i].chinese+stu[i].match)/2; PR("%s的平均成绩是:%d\n",stu[i].name,ave); } } void main() { average_one(); int i; SC("%d",&i); switch(i); {[local]1[/local] case 1:printf("yes!\n");break; case 2:printf("no!\n");break; default:printf("error\n"); } }
拜托了