include <string.h> int main(){ char a[100] ; //定义一个字符串,数组,存储输入的汉字 scanf("%s",a); //输入一串汉字 if ( strcmp(a, "汉字" ) == 0 ) //等于0表示相等 { printf("yes!\n");} else { printf("no!\n");} return 0;} ...
include <stdio.h>#include <string.h>int main(void){ char s[100]; printf("请输入汉字"); gets(s); if(strcpy(s,"哈哈")) printf("Yes!"); }