.cpp可以运行怎么.c不可以运行了?怎么改啊?
#include<stdio.h>typedef struct Student{
int num;
char name[20];
char dengji
;
};
main(){
int i,x,a=0,b=0,c=0,d=0,e=0;
Student student[100];
printf("number: ");
scanf("%d",&x);
for(i=0;i<x;i++){
printf("input student%d info\n",i+1);
printf("num name dengji");
scanf("%d",&student[i].num);getchar();
scanf("%s",&student[i].name);getchar();
scanf("%c",&student[i].dengji);getchar();
if(student[i].dengji=='A')a=a+1;
if(student[i].dengji=='B')b=b+1;
if(student[i].dengji=='C')c=c+1;
if(student[i].dengji=='D')d=d+1;
if(student[i].dengji=='E')e=e+1;
}
printf("A:%d B:%d C:%d D:%d E:%d",a,b,c,d,e);
}