69,373
社区成员
发帖
与我相关
我的任务
分享
char user[]={"tjh"},passward[]={"123456"};
char ustr[10],pwstr[10];
int i=0;
while(i<3)
{
printf("Plase input name :\n");
fflush(stdout);
gets(ustr);
printf("Plase input passward :\n");
fflush(stdout);
gets(pwstr);
if(strcmp(ustr,user))
{
printf("Incorrect user name entered!\n");
}
else
{
if(strcmp(passward,pwstr))
{
printf("Incorrect passward entered!\n");
}
else
{
printf("Congratulations, success!\n");
break;
}
}
++i;
}