请问大神这个程序哪里不对了,dos窗口提示xxx.exe程序已停止工作
#include "stdio.h"#include "string.h"
#define M 2
#define W 2
#define ns 2
#define na 2
int main()
{
struct Athlete
{
int item;
int school;
int place;
char name[20];
int score;
char sex;
};
struct Athlete ath[na];
for(int i=0;i<na;i++)
{
printf(" òÔÏÂêÇμú%d¸öÔ˶ˉÔ±DÅÏ¢μÄêäèë\n",i+1);
printf("ÇëêäèëÔ˶ˉÔ±DÔ±e±êÖ¾£¨ÄDm/Å®w£©:");
scanf("%c",&ath[i].sex);
getchar();rewind(stdin);
printf("ÇëêäèëÔ˶ˉÔ±2μóÏîÄ¿±àoÅ:");
scanf("%d",&ath[i].item);
printf("ÇëêäèëÔ˶ˉÔ±ËùêôѧD£±àoÅ:");
scanf("%d",&ath[i].school);
printf("ÇëêäèëÔ˶ˉÔ±ÏîÄ¿ÅÅÃû:");
scanf("%d",&ath[i].place);
printf("ÇëêäèëÔ˶ˉÔ±DÕÃû£¨2»¶àóú20¸ö×Ö·û£©:");
scanf("%s",ath[i].name);
printf("\n");
if(ath[i].place==1)
ath[i].score=5;
else if(ath[i].place==2)
ath[i].score=3;
else if(ath[i].place==3)
ath[i].score=2;
else
ath[i].score=0;
}
for(int j=1;j<=ns;j++)
{
printf("**********************ѧD£±àoÅ%d***************************\n",j);
printf(" ÏîÄ¿oÅ Ãû′Î Ô˶ˉÔ±DÕÃû μÃ·Ö \n");
for(int i=0;i<na;i++)
{
if(ath[i].school==j && ath[i].sex=='m')
{
for(int k=1;k<=M;k++)
{
if(ath[i].item==k)
printf(" ÄD×ó %d %d %s %d\n",k,ath[i].place,ath[i].name[20],ath[i].score);
}
}
else if(ath[i].school==j && ath[i].sex=='w')
{
for(int k=1;k<=W;k++)
{
if(ath[i].item==k)
printf(" Å®×ó %d %d %s %d\n",k,ath[i].place,ath[i].name[20],ath[i].score);
}
}
}
}
return 0;
}