用户:
阿柒之魔刀千刃查看:0 回复:2 评论:0 创建时间:2020-08-15T20:02:46
(ID加密码,输入三遍,三遍输入正确,显示输入成功,登录代码岛,三次输入错误,显示"三次输入错误,bye-bye)
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
main(void)
{
int i,h;
char d,c;
printf("请输入ID:");\\ID为182033喵33
scanf("%s",d);
printf("请输入密码:");\\密码为ck5671234
scanf("%s",c);
if(d!="182033喵33 && c!=ck5671234);
do
{
h--;
printf("还有%d次机会输入。",h);
}
while(h=3);
{
if(h==0)
printf("三次输入错误,bye-bye");
}
printf("输入成功,登录代码岛");
return 0;
}
用户不会编程猫if(d!="1820336433 && c!=ck5671234);和下面的do为什么不用 do……while呢?而且这do……while用的不对,这里的while后面只有分号不能再跟语句,而且if条件后面没有分号,会报错
点赞0
评论