用C语言写一个小程序,判断输入的汉字是否正确,如里输入的是数字 大小写字母 标点符号 提示输入错误

标点符号包括(@#%+_";/|……)等,再说一下,如果要判断输入的汉字是:小刘好,那么只要输入的不是这三个字,提示输入错误,请再次输入,只有全对了,才输出:你的信息以确认(这些字可随便改),写好后希望给程序详细的分析,分析!!这个我不会想学学,要能在VC++上运行哟!希望那位有多余时间的给我写写好吗?谢谢!!

#include<stdio.h>
#include<string.h>

#include<string.h>
#include<stdio.h>
int main()
{
char s[100];
while(true)
{
gets(s);
if(strcmp(s,"小刘好")==0)break;

}
puts("你的信息以确认");
return 0;
}
/*

*/追问

咱了有一点不对呀???error C2065: 'true' : undeclared identifier

追答

#include
#include

#include
#include
int main()
{
char s[100];
while(1)
{
gets(s);
if(strcmp(s,"小刘好")==0)break;

}
puts("你的信息以确认");
return 0;
}
/*

*/

追问

如果想加入一句提示:printf("你输入有误请重新输入:\n"); 咱加呀?加在那里呀??

追答

#include
#include

#include
#include
int main()
{
char s[100];
while(1)
{
gets(s);
if(strcmp(s,"小刘好")==0)break;
printf("你输入有误请重新输入:\n");
}
puts("你的信息以确认");
return 0;
}
/*

*/

温馨提示:答案为网友推荐,仅供参考
相似回答