-
Notifications
You must be signed in to change notification settings - Fork 0
/
1035.cpp
76 lines (69 loc) · 1.29 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
using namespace std;
struct Account
{
string name;
string password;
};
int main()
{
int N;
scanf("%d", &N);
vector<Account> accounts(N);
char name[11];
char password[11];
for (int i = 0; i < N; i++)
{
scanf("%s %s", name, password);
accounts[i].name = name;
accounts[i].password = password;
}
bool flag = false;
vector<Account> result;
for (int i = 0; i < N; i++)
{
int size = accounts[i].password.size();
flag = false;
for (int j = 0; j < size; j++)
{
switch (accounts[i].password[j])
{
case '1':
accounts[i].password[j] = '@';
flag = true;
break;
case '0':
accounts[i].password[j] = '%';
flag = true;
break;
case 'l':
accounts[i].password[j] = 'L';
flag = true;
break;
case 'O':
accounts[i].password[j] = 'o';
flag = true;
break;
}
}
if (flag == true)
result.push_back(accounts[i]);
}
if (result.size()==0)
{
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);
}
else
{
printf("%d\n", result.size());
for (int i = 0; i < result.size(); i++)
printf("%s %s\n", result[i].name.c_str(), result[i].password.c_str());
}
return 0;
}