水题
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
struct node
{
string name;
string password;
bool modified;
}person[MAXN];
int main(void)
{
freopen("pat0314/in.txt","r",stdin);
int n;
cin>>n;
bool flag = false;
for(int i = 0;i<n;i++)
{
cin>>person[i].name>>person[i].password;
}
for(int i = 0;i<n;i++)
{
for(int j = 0;j<person[i].password.size();j++)
{
if(person[i].password[j] == 'l')
{
flag = true;
person[i].modified = true;
person[i].password[j] = 'L';
}
else if(person[i].password[j] == '0')
{
flag = true;
person[i].modified = true;
person[i].password[j] = '%';
}
else if(person[i].password[j] == 'O')
{
flag = true;
person[i].modified = true;
person[i].password[j] = 'o';
}
else if(person[i].password[j] == '1')
{
flag = true;
person[i].modified = true;
person[i].password[j] = '@';
}
}
}
if(flag == false && n == 1)
{
cout<<"There is 1 account and no account is modified"<<endl;
}
else if(flag == false && n > 1)
{
printf("There are %d accounts and no account is modified\n",n);
}
if(flag == true)
{
int num = 0;
for(int i = 0;i<n;i++)
{
if(person[i].modified == true)
{
num++;
}
}
cout<<num<<endl;
for(int i = 0;i<n;i++)
{
if(person[i].modified == true)
{
cout<<person[i].name<<" "<<person[i].password<<endl;
}
}
}
return 0;
}```