#include<stdio.h>
#include<iostream>
#include<string>
#include<string.h>
using namespace std;
int main(){
string pass, str;
int i, n, time=0, w_time=0;
bool flag=false;
cin>>pass>>n;
getchar();
while(getline(cin,str)){
if(str=="#")break;
time++;
if(str==pass&&time<=n){cout<<"Welcome in"<<endl;return 0;}
else {
w_time++;
if(w_time<=n&&!flag)cout<<"Wrong password: "<<str<<endl;
if(w_time>=3){cout<<"Account locked"<<endl;return 0;}
}
}
return 0;
}
PAT-B1067
最新推荐文章于 2022-02-18 17:54:10 发布