-
Notifications
You must be signed in to change notification settings - Fork 0
/
pta1035.cpp
76 lines (71 loc) · 1.27 KB
/
pta1035.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 <bits/stdc++.h>
using namespace std;
const int radix = 13;
struct node{
string name;
string psd;
};
vector<node>ans;
int mo_psd(node &tem);
int main()
{
string str;int n,cnt=0;
cin>>n;node tem;
for(int i=0;i<n;++i)
{
cin>>tem.name>>tem.psd;
if(mo_psd(tem))
{
ans.push_back(tem);
}
}
//tihuan
cnt=ans.size();
if(cnt==0 &&n>1)
{
cout<<"There are "<<n<<" accounts and no account is modified"<<endl;
return 0;
}
else if(cnt==0 &&n==1)
{
cout<<"There is 1 account and no account is modified"<<endl;
return 0;
}
cout<<cnt<<endl;
for(node i:ans)
{
cout<<i.name<<" "<<i.psd<<endl;
}
return 0;
}
int mo_psd(node &tem)
{
string s=tem.psd;
int sign=0;
for(int i=0;i<tem.psd.length();++i)
{
if(s[i]=='l')
{
sign=1;
tem.psd[i]='L';
}
else if(s[i]=='1')
{
sign=1;
tem.psd[i]='@';
}
else if(s[i]=='0')
{
sign=1;
tem.psd[i]='%';
}
else if(s[i]=='O')
{
sign=1;
tem.psd[i]='o';
}
}
if(!sign)
return 0;
return 1;
}