-
Notifications
You must be signed in to change notification settings - Fork 0
/
1035.cpp
59 lines (57 loc) · 1.35 KB
/
1035.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <iostream>
#include <vector>
using namespace std;
struct User{
string name;
string pw;
bool modified;
};
int main(){
int n;
cin >> n;
vector<User> u(n);
int count = 0;
for (int i=0; i<n; i++){
cin >> u[i].name >> u[i].pw;
bool modified = false;
for (int j=0; j<u[i].pw.size(); j++){
if (u[i].pw[j]=='1'){
u[i].pw[j] = '@';
modified = true;
}
else if (u[i].pw[j]=='0'){
u[i].pw[j] = '%';
modified = true;
}
else if (u[i].pw[j]=='l'){
u[i].pw[j] = 'L';
modified = true;
}
else if (u[i].pw[j]=='O'){
u[i].pw[j] = 'o';
modified = true;
}
}
if (modified){
u[i].modified = true;
count++;
}
}
if (count==0){
if (n==1){
cout << "There is 1 account and no account is modified" << endl;
}
else{
cout << "There are " << n << " accounts and no account is modified" << endl;
}
}
else{
cout << count << endl;
for (int i=0; i<n; i++){
if (u[i].modified){
cout << u[i].name << " " << u[i].pw << endl;
}
}
}
return 0;
}