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:

3
Team000002 Rlsp0dfa
Team000003 perfectpwd
Team000001 R1spOdfa

Sample Output 1:

2
Team000002 RLsp%dfa
Team000001 R@spodfa

Sample Input 2:

1
team110 abcdefg332

Sample Output 2:

There is 1 account and no account is modified

Sample Input 3:

2
team110 abcdefg222
team220 abcdefg333

Sample Output 3:

There are 2 accounts and no account is modified
 #include<cstdio>
#include<iostream>
using namespace std;
int main(){
int N, modfi[] = {}, count = ;
char acc[][], pwd[][];
scanf("%d", &N);
for(int i = ; i < N; i++){
scanf("%s%s",acc[i], pwd[i]);
for(int j = ; pwd[i][j] != '\0'; j++){
if(pwd[i][j] == ''){
pwd[i][j] = '@';
modfi[i] = ;
}else if(pwd[i][j] == ''){
pwd[i][j] = '%';
modfi[i] = ;
}else if(pwd[i][j] == 'l'){
pwd[i][j] = 'L';
modfi[i] = ;
}else if(pwd[i][j] == 'O'){
pwd[i][j] = 'o';
modfi[i] = ;
}
}
if(modfi[i] == )
count++;
}
if(count == ){
if(N == )
printf("There is 1 account and no account is modified");
else
printf("There are %d accounts and no account is modified", N);
}else{
printf("%d", count);
for(int i = ; i < N; i++)
if(modfi[i] == )
printf("\n%s %s", acc[i], pwd[i]);
}
cin >> N;
return ;
}

A1035. Password的更多相关文章

  1. A1035 Password (20)(20 分)

    A1035 Password (20)(20 分) To prepare for PAT, the judge sometimes has to generate random passwords f ...

  2. PAT甲级——A1035 Password

    To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...

  3. PAT A1035 Password

    题目描述: To prepare for PAT, the judge sometimes has to generate random passwords for the users. The pr ...

  4. PAT A1035 Password (20)

    AC代码 注意创造函数条件中使用引用 输出语句注意单复数 #include <cstdio> #include <cstring> #include <iostream& ...

  5. PAT/字符串处理习题集(二)

    B1024. 科学计数法 (20) Description: 科学计数法是科学家用来表示很大或很小的数字的一种方便的方法,其满足正则表达式[+-][1-9]"."[0-9]+E[+ ...

  6. PAT题目AC汇总(待补全)

    题目AC汇总 甲级AC PAT A1001 A+B Format (20 分) PAT A1002 A+B for Polynomials(25) PAT A1005 Spell It Right ( ...

  7. 1035 Password (20 分)

    1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for th ...

  8. 打开程序总是会提示“Enter password to unlock your login keyring” ,如何成功关掉?

    p { margin-bottom: 0.1in; line-height: 120% } 一.一开始我是按照网友所说的 : rm -f ~/.gnome2/keyrings/login.keyrin ...

  9. your password has expired.to log in you must change it

    今天应用挂了,log提示密码过期.客户端连接不上. 打开mysql,执行sql语句提示密码过期 执行set password=new password('123456'); 提示成功,但客户端仍然连接 ...

随机推荐

  1. Appium Studio 初体验(windows做ios自动化,录制appium脚本)

    偶然的机会遇到了这个工具——Appium Studio, 在官网是这么解释的 Get your Appium testing projects going within minutesInstall ...

  2. 【下一代核心技术DevOps】:(三)私有代码库阿里云Git使用

    1. 引言 使用DevOps肯定离不开和代码的集成.所以要想跑通整套流程,代码库的选型也是非常重要的.否则无法实现持续集成.目前比较常用的代码管理有SVN和GIt 如果还使用SVN的,建议尽早迁移到G ...

  3. GlusterFS分布式存储数据的恢复机制(AFR)的说明

    GlusterFSFS恢复数据都是基于副本卷来说的,GlusterFSFS复制卷是采用镜像的方式做的,并且是同步事务性操作.简单来说就是,某一个客户要写文件时,先把这个文件锁住,然后同时写两个或多个副 ...

  4. 完整部署CentOS7.2+OpenStack+kvm 云平台环境(2)--云硬盘等后续配置

    继上一篇博客介绍了完整部署CentOS7.2+OpenStack+kvm 云平台环境(1)--基础环境搭建,本篇继续讲述后续部分的内容 1 虚拟机相关1.1 虚拟机位置介绍 openstack上创建的 ...

  5. SQL中not in 和not exists

    在SQL中倒是经常会用到子查询,而说到子查询,一般用的是in而不是exists,先不谈效率问题,就先说说会遇到哪些问题. 用到in当取反的时候,肯定先想到的就是not in.但是在使用not in的时 ...

  6. Segment Occurrences(string find函数)

    Description You are given two strings s and t, both consisting only of lowercase Latin letters.The s ...

  7. Linux内核分析——进程的描述和进程的创建

    进程的描述和进程的创建 一. 进程的描述 (一)进程控制块PCB——task_struct 1.操作系统的三大管理功能包括: (1)进程管理 (2)内存管理 (3)文件系统 2.PCB task_st ...

  8. 第二次sprint

    一.这次冲刺就是实施阶段了,主要对程序进行一次骨架的构建,基本上已经完成了界面的设计,但是在算法上还有很大漏洞,整个程序还是属于不成熟阶段. 二.这是我们的界面 三.已经有的功能:随机生成题目并算出答 ...

  9. FreeMaker使用HashMap

    private Map<String, Object> variables; <input type="hidden" id="tongzhisbm&q ...

  10. ESXi 更新补丁 暂时未测试 等有时间尝试一下.

    下载地址: https://my.vmware.com/group/vmware/patch 使用操作图: 选择相应的zip包下载即可 更新方式: 命令方式升级ESXi主机补丁包 1.进入VMware ...