简单地结构体编程问题
各路大神们,我是一只菜鸟,今天编了一个小程序,发现运行不了,倒是没有错误,有图有真相!请求牛人帮忙啊!先谢谢啦!!
#include<stdio.h>
#include<string.h>
struct People
{
char name[20];
int count;
}people_name[3]={"li",0,"zhang",0,"wang",0};
int main()
{
int i,j;
char Name[20];
printf("请输入候选人姓名:\n");
for(i=1;i<=10;i++)
{
scanf("%s",Name[i]);
for(j=1;j<=3;j++)
if(strcmp(people_name[j].name,Name[i])==0)
people_name[j].count++;
}
printf("结果为:");
for(i=1;j<=3;j++)
printf("%5s,%d",people_name[j].name,people_name[j].count);
return 0;
}