首页 > 应用开发 > > 这个为啥运行不出来啊
#include <stdio.h>
#include <string.h>
void main()
{
int i;
char *colour[]={"red", "blue", "yellow", "green", "black" };
char str[50];
getchar();
scanf("%s",str);
for(i=0;i<5;i++)
if(strcmp(colour[i],str)==0)
{
printf("%d\n",i+1);
break;
}
if (i==5)
printf("Not Found\n");
}来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4715/viewspace-3119323/ ,如需转载,请注明出处,否则将追究法律责任。