AcWing 1519. 密码
原题链接
简单
作者:
李sir
,
2021-03-18 15:42:29
,
所有人可见
,
阅读 252
#include <iostream>
using namespace std;
const int N=1010;
string change(string str)
{
string res;
for(auto c:str)
if(c=='1') res+="@";
else if(c=='0') res+="%";
else if(c=='l') res+="L";
else if(c=='O') res+="o";
else res+=c;
return res;
}
int main()
{
int n;
cin>>n;
string change_id[N],change_pwd[N];
int k=0;
for(int i=0;i<n;i++)
{
string id,pwd;
cin>>id>>pwd;
string changed_pwd=change(pwd);
if(pwd!=changed_pwd)
{
change_pwd[k]=changed_pwd;
change_id[k]=id;
k++;
}
}
if(!k)
{
if(n==1) puts("There is 1 account and no account is modified");
else printf("There are %d accounts and no account is modified",n);
}else
{
cout<<k<<endl;
for(int i=0;i<k;i++)
{
cout<<change_id[i]<<' '<<change_pwd[i]<<endl;
}
}
return 0;
}