回复 9楼 shmilyflf
亲,我用数组了,但我用if判断的时候满足条件的情况下没运行if下的代码,我先回去测试下是条件问题还是储存问题好了
程序代码:#include <stdio.h>
#include <string.h>
int main()
{
char* test="中国";
char s[20]={'\0'};
scanf("%s",&s[0]);
if(strcmp(s,test)==0) printf("你是中国人\n");else printf("你是外国人吗?\n");
printf("\n");
return 0;
}








