-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathB1067.cpp
More file actions
31 lines (29 loc) · 802 Bytes
/
B1067.cpp
File metadata and controls
31 lines (29 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*************************************************************************
> File Name: B1067.cpp
> Author: bumzy
> Mail: bumzy@gmail.com
> Created Time: 2017年07月30日 星期日 17时48分06秒
************************************************************************/
#include <iostream>
#include <string>
using namespace std;
int main(void) {
string pw, input;
int n, cnt = 0;
cin >> pw >> n;
getchar();
while (getline(cin, input) && input != "#") {
cnt++;
if (cnt <= n && input == pw) {
cout << "Welcome in" << endl;
break;
} else {
cout << "Wrong password: " << input << endl;
}
if (cnt == n) {
cout << "Account locked" << endl;
break;
}
}
return 0;
}