#include<cstdio>
#include<algorithm>
#include<stdlib.h>
#include<cstring>
#include<math.h>
struct pnode
{
char name[20];
char pw[20];
bool ischange;
}temp[1010];
int main()
{
int n,k=0;
int len;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%s %s",temp[i].name,temp[i].pw);
len=strlen(temp[i].pw);
temp[i].ischange=false;
for(int j=0;j<len;j++)
{
if(temp[i].pw[j]=='1')
{
temp[i].pw[j]='@';
temp[i].ischange=true;
}
else
if(temp[i].pw[j]=='l')
{
temp[i].pw[j]='L';
temp[i].ischange=true;
}
else
if(temp[i].pw[j]=='0')
{
temp[i].pw[j]='%';
temp[i].ischange=true;
}
else
if(temp[i].pw[j]=='O')
{
temp[i].pw[j]='o';
temp[i].ischange=true;
}
}
if(temp[i].ischange)
k++;
}
if(k!=0)
{
printf("%d\n",k);
for(int i=0;i<n;i++)
{
if(temp[i].ischange==true)
printf("%s %s\n",temp[i].name,temp[i].pw);
}
}
else if(n==1&&k==0)
printf("There is %d account and no account is modified",n);
else
printf("There are %d accounts and no account is modified",n);
system("pause");
return 0;
}
PAT 1035
最新推荐文章于 2021-02-06 19:11:20 发布
本文介绍了一个简单的C语言程序,该程序用于批量修改用户密码中的特定字符。例如,将数字1替换为符号@,小写字母l替换为大写字母L等。程序通过遍历输入的密码字符串并检查每个字符来实现这一功能。
3043

被折叠的 条评论
为什么被折叠?



