-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1035 Password.cpp
More file actions
46 lines (44 loc) · 974 Bytes
/
Copy path1035 Password.cpp
File metadata and controls
46 lines (44 loc) · 974 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <bits/stdc++.h>
using namespace std;
int n;
struct node{
string user, pas;
bool flag;
}p[1005];
string modify(string pas){
string modi_pas = "";
for (int i = 0; i < pas.size(); ++i){
if (pas[i] == '1') modi_pas += '@';
else if (pas[i] == '0') modi_pas += '%';
else if (pas[i] == 'l') modi_pas += 'L';
else if (pas[i] == 'O') modi_pas += 'o';
else modi_pas += pas[i];
}
return modi_pas;
}
int times;
int main(){
scanf("%d", &n);
for (int i = 0; i < n; ++i){
cin >> p[i].user >> p[i].pas;
string new_pas = modify(p[i].pas);
if (new_pas != p[i].pas) {
times++;
p[i].flag = true;
p[i].pas = new_pas;
}
}
if (times == 0) {
if (n == 1) printf("There is 1 account and no account is modified\n");
else printf("There are %d accounts and no account is modified\n", n);
}
else {
printf("%d\n", times);
for (int i = 0; i < n; ++i){
if (p[i].flag){
cout << p[i].user << " " << p[i].pas << endl;
}
}
}
return 0;
}