各位大哥大姐,,帮帮忙,我这程序错哪了??
#include "stdio.h"#include "string.h"
struct leader
{
char name[5];
float count;
}stu[3]={{"Li",0},{"Liu",0},{"Xiao",0}};
main()
{
int i,j;
char Leader_name[10];
for(i=0;i<3;i++)
{
scanf("%s",Leader_name);
for(j=0;j<3;j++)
{
if(strcmp(Leader_name,stu[j].name)==0)
stu[j].count++;
}
}
for(i=0;i<3;i++)
{
printf("%s:%d\n",stu[i].name,stu[i].count);
}
}
[ 本帖最后由 刘燕媚prince 于 2013-10-27 10:42 编辑 ]