c = 1 while c < 4: a = input("请输入用户名") if a != "xu": print("登录失败") c = c + 1 elif a == "xu": print("登录成功") break print("请退出")