#include <stdio.h>
int main()
{
char arr1[10]={0};
int i;
for(i = 0; i < 3; i++)
{
printf("please enter your password:\n");
scanf("%s", arr1);
if(strcmp(arr1, "123456") == 0)
break;
}
if(i == 3)
{
printf("Three opportunities have been exhausted!\n");
return 0;
}
else
printf("Successful landing!\n");
return 0;
}
//输出:
please enter your password:
34567
please enter your password:
123456
Successful landing!