PAT 甲级 1035 Password
发布日期:2021-07-01 03:09:04 浏览次数:2 分类:技术文章

本文共 1988 字,大约阅读时间需要 6 分钟。

1035 Password (20 point(s))

To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O (o in uppercase). One solution is to replace 1 (one) by @0 (zero) by %l by L, and O by o. Now it is your job to write a program to check the accounts generated by the judge, and to help the juge modify the confusing passwords.

Input Specification:

Each input file contains one test case. Each case contains a positive integer N (≤1000), followed by N lines of accounts. Each account consists of a user name and a password, both are strings of no more than 10 characters with no space.

Output Specification:

For each test case, first print the number M of accounts that have been modified, then print in the following M lines the modified accounts info, that is, the user names and the corresponding modified passwords. The accounts must be printed in the same order as they are read in. If no account is modified, print in one line There are N accounts and no account is modified where N is the total number of accounts. However, if N is one, you must print There is 1 account and no account is modified instead.

Sample Input 1:

3Team000002 Rlsp0dfaTeam000003 perfectpwdTeam000001 R1spOdfa

Sample Output 1:

2Team000002 RLsp%dfaTeam000001 R@spodfa

Sample Input 2:

1team110 abcdefg332

Sample Output 2:

There is 1 account and no account is modified

Sample Input 3:

2team110 abcdefg222team220 abcdefg333

Sample Output 3:

There are 2 accounts and no account is modified

经验总结:

这一题....难度是没啥难度的,就是注意,如果追求更快的速度,那么使用stdio的IO比iostream的IO要快一些~~( ‘-ωก̀ )

AC代码 

#include 
#include
#include
#include
#include
#include
#include
#include
using namespace std;struct node{ char a[20],b[20];}s;bool judge(node & x){ int flag=0; int len=strlen(x.b); for(int i=0;i
ans; for(int i=0;i

 

转载地址:https://meteorrain.blog.csdn.net/article/details/86618185 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:PAT 甲级 1036 Boys vs Girls
下一篇:PAT 甲级 1034 Head of a Gang

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2024年05月04日 12时48分37秒