博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
pat1035. Password (20)
阅读量:4614 次
发布时间:2019-06-09

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

1035. Password (20)

时间限制
400 ms
内存限制
65536 kB
代码长度限制
16000 B
判题程序
Standard
作者
CHEN, Yue

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

 

1 #include
2 #include
3 #include
4 #include
5 #include
6 #include
7 #include
8 #include
9 using namespace std;10 vector
v;11 map
ha;12 bool check(char &c){13 if(c=='1'){14 c='@';15 return true;16 }17 if(c=='0'){18 c='%';19 return true;20 }21 if(c=='l'){22 c='L';23 return true;24 }25 if(c=='O'){26 c='o';27 return true;28 }29 return false;30 }31 int main(){32 //freopen("D:\\INPUT.txt","r",stdin);33 int n;34 scanf("%d",&n);35 int i,j;36 string num,pas;37 int count=0;38 for(i=0;i
>num>>pas;40 bool can=false;41 for(j=0;j

 

转载于:https://www.cnblogs.com/Deribs4/p/4782220.html

你可能感兴趣的文章
最基础的applet运用--在applet上画线
查看>>
并不对劲的hdu4777
查看>>
linux使用rz、sz快速上传、下载文件
查看>>
判断数字的正则表达式
查看>>
DOC常用命令(转)
查看>>
php写一个判断是否有cookie的脚本
查看>>
Mac配置Fiddler抓包工具
查看>>
转:Java并发集合
查看>>
Word截图PNG,并压缩图片大小
查看>>
Python项目对接CAS方案
查看>>
mysql产生随机数
查看>>
编程风格
查看>>
熟悉常用的Linux命令
查看>>
易之 - 我是个大师(2014年3月6日)
查看>>
Delphi中窗体的事件
查看>>
file_get_contents()获取https出现这个错误Unable to find the wrapper “https” – did
查看>>
linux vi编辑器
查看>>
js树形结构-----(BST)二叉树增删查
查看>>
contract
查看>>
FJUT ACM 1899 Largest Rectangle in a Histogram
查看>>