结构体问题!!!!为什么读不进去
程序代码:
#include<stdio.h> #include<stdlib.h> int main(void) { struct student{ int num; char name[10]; int english; int math; int cgrade;; }; struct student *p,*q; int i,n,score=0; printf("Input n:"); scanf("%d",&n); p=(struct student *)malloc(sizeof(struct student)*n); if(p==NULL) exit(1); for(i=1;i<=n;i++){ printf("第%d个学生各科成绩:",i); scanf("%d%%s%d%d%d",&p->num,p->name,&p->english,&p->math,&p->cgrade); score=p->english+p->math+p->cgrade; p++; printf("score=%d\n",score); } return 0; }为什么会出错呀