2 shunfurh shunfurh 于 2017.09.08 22:53 提问

Generate Passwords

To prepare for programming contests or coding examinations, 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
There are multiple test cases. 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. A test case with N = 0 denotes the end of input. This test case is not to be processed.

Output
For each 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 "No account is modified."

Sample Input:
2
Team000001 R1spOdfa
Team000002 Rlsp0dfa
1
team110 abcdefg332
0
Sample Output:
2
Team000001 R@spodfa
Team000002 RLsp%dfa
No account is modified.

1个回答

caozhy
caozhy   Ds   Rxr 2017.09.24 08:32
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
ZOJ 2514 Generate Passwords 水
啦啦啦,水一发准备去复习功课~ ------------------------------------------水一发的分割线------------------------------------------ http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1514 水题,没有一次AC我很惭愧,竟然忘了输出总共的个数
zoj 2514 Generate Passwords
//题目比较简单,就按题目的要求,如果密码有得修改的就修改,如果没有就输出! #include "iostream" #include "string" #include "map" #include "vector" using namespace std; struct Info { string name; string password; }; int main() { int
ZOJ 2514 Generate Passwords
水题,字符替换,不解释了. #include #include #include const int maxn = 1010; int n; char usn[maxn][15], pwd[maxn][15]; bool modified[maxn]; int main(){ while(scanf("%d", &n) && n){ memset(modified, 0, size
zoj2514 Generate Passwords
Generate Passwords Time Limit: 2000MS   Memory Limit: 65536KB   64bit IO Format: %lld & %llu Submit Status Description To prepare for programming contests or coding exami
zoj 2514 Generate Passwords(水!)
<br />现在刷水题速度真慢!我快哭了。。。一堆BUG。。。检查了半天把等号写成赋值了!我撞墙去,不要拦我!!!<br /> <br />#include <stdio.h> #include <stdlib.h> #include <iostream> #include <string.h> using namespace std; int main(void) { int n,flag; char str[1005][2][15]; int num[1005],size;
zoj 2514 Generate Passwords 水题
可恶的字符串!!水题,但还是WA了无数次啊!为什么用个结构体就是过不去,换成数组就a了。。不解释。#include #include int main() { char u[1000][100],p[1000][100]; int flag[1000]; int n; while(scanf("%d",&n)&&n) {
杭电OJ——1039 Easier Done Than Said?(水题)
Easier Done Than Said? Problem Description Password security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Som
MySQL主从复制基础搭建
在学习配置Mysql的主从 这个文章只是 把基础主从配置通了 但是有很多设定的配置没有进行搭建 MySQL版本:5.6.24 1、修改主从配置(就是/etc/my.cnf文件) 主:[mysqld]         -- 这个只是告诉你 下面的配置是mysqld的配置 log_bin = mysql-bin server_id = 131     --这个是唯一标识,
Mongo新建用户Error
新版本Mongo新建用户Error: couldn’t add user: Use of SCRAM-SHA-256 requires undigested passwords : 解决办法:修改mechanisms加密方式 db.createUser( { user: “admin”, pwd: “xxx”, roles: [ { role: “userA...
you must install the sshpass program 解决方式
安装完ansible之后,使用的时候发生如下错误:ansible 192.168.1.2 -i ./hosts -m shell -a "date" 192.168.1.2 | FAILED => to use the 'ssh' connection type with passwords, you must install the sshpass program只需要安装sshpass即可,Ce