#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
int i=0;
char input[10];
char *passwd={"123456"};
for (i=1;1<3;i++)
{
printf("請輸入密碼>:");
scanf("%s",&input);
if (strcmp(passwd,input)==0)
{
break;
}
else
{
printf("密碼輸入錯誤\n");
if(i==3)
{
printf("三次輸入有誤!\n");
exit (0);
}
}
}
printf("登陸成功!\n");
return 0;
}