#include
#include
int main()
{
char str[200];
while(1)
{
printf("请输入: "); //输出提示信息
scanf("%s", &str); //等待从键盘读入一个字符串到变量str里
//使用c库里的strcmp判断输入的字符串,strcmp返回0时表示相同
//,如要忽略大小写使用strcmpi函数
if( strcmp(str, "sapphire")==0
|| strcmp(str, "josiah")==0 )
printf( "hello, %s\n", str );
else
printf( "Sorry,you are not……\n" );
}
}