题目没有什么坑,一发过
#include <iostream>
#include <string>
using namespace std;
string str;
int main(){
string right;
int n;
int count = 0;
cin>>right>>n;
getchar();
while(getline(cin,str) && str != "#"){
if(str != right && count < n){
cout<<"Wrong password: "<<str<<endl;
count++;
}else if(str == right && count < n){
cout<<"Welcome in";
return 0;
}
if(count == n){
cout<<"Account locked";
return 0;
}
}
return 0;
}