编程题:Please login
Design a login program to allow users to enter password.
(1)If the password entered is zust, print Success. This indicates that the login is complete
(2)Otherwise print Password error, and the user can enter again.
The user is allowed to enter at most 3 times. After three failures, print Login failed.
### Input Specification:
Enter the password in one line. If there is an error, you need to re-enter it. At most 3 times.
### Output Specification:
Print results according to input
### Sample Input #1:
in
abc
zust
### Sample Output #1:
out
Password error
Success
### Sample Input #2:
in
zust
### Sample Output #2:
out
Success
### Sample Input #3:
in
china
12345
zuss
### Sample Output #3:
out
Password error
Password error
Password error
Login failed
答案:若无答案欢迎评论
(1)If the password entered is zust, print Success. This indicates that the login is complete
(2)Otherwise print Password error, and the user can enter again.
The user is allowed to enter at most 3 times. After three failures, print Login failed.
### Input Specification:
Enter the password in one line. If there is an error, you need to re-enter it. At most 3 times.
### Output Specification:
Print results according to input
### Sample Input #1:
in
abc
zust
### Sample Output #1:
out
Password error
Success
### Sample Input #2:
in
zust
### Sample Output #2:
out
Success
### Sample Input #3:
in
china
12345
zuss
### Sample Output #3:
out
Password error
Password error
Password error
Login failed
答案:若无答案欢迎评论