#include<stdio.h>标签:code,--,密码,int,printf,answer,输入 From: https://blog.51cto.com/u_15923331/5980109
int main()
{
int i = 0;
int code = 0;
int answer = 667788;
for (i = 1; i <= 3; i++)
{
printf("请输入你的密码 ");
scanf_s("%d", &code);
if (code == answer)
{
printf("密码正确\n");
break;
}
else
{
printf("密码错误 \n");
}
if (i == 3)
{
printf("输入次数过多请稍后再试\n");
}
}
return 0;
}