-
Notifications
You must be signed in to change notification settings - Fork 814
/
Copy path1035. Password (20).cpp
36 lines (36 loc) · 1008 Bytes
/
1035. Password (20).cpp
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
32
33
34
35
36
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
scanf("%d", &n);
vector<string> v;
for(int i = 0; i < n; i++) {
string name, s;
cin >> name >> s;
int len = s.length(), flag = 0;
for(int j = 0; j < len; j++) {
switch(s[j]) {
case '1' : s[j] = '@'; flag = 1; break;
case '0' : s[j] = '%'; flag = 1; break;
case 'l' : s[j] = 'L'; flag = 1; break;
case 'O' : s[j] = 'o'; flag = 1; break;
}
}
if(flag) {
string temp = name + " " + s;
v.push_back(temp);
}
}
int cnt = v.size();
if(cnt != 0) {
printf("%d\n", cnt);
for(int i = 0; i < cnt; i++)
cout << v[i] << endl;
} else if(n == 1) {
printf("There is 1 account and no account is modified");
} else {
printf("There are %d accounts and no account is modified", n);
}
return 0;
}