1035 Password (20)
#include <stdio.h>
#include <string.h>
struct MyStruct
{
char ID[];
char Password[];
bool changed;
};
int main()
{
int n,i,j;
MyStruct User[];
while(scanf("%d",&n)!=EOF)
{
for(i=;i<n;i++)
User[i].changed=false;
int count = ;
for(i=;i<n;i++)
{
getchar();
scanf("%s %s",User[i].ID,User[i].Password);
int fir=;
for(j=;j<strlen(User[i].Password);j++)
{ if(User[i].Password[j]==''||User[i].Password[j]==''||User[i].Password[j]=='l'||User[i].Password[j]=='O')
{
if(fir)
{
fir=;
++count;
}
if(User[i].Password[j]=='') User[i].Password[j]='@';
else if(User[i].Password[j]=='') User[i].Password[j]='%';
else if(User[i].Password[j]=='l') User[i].Password[j]='L';
else if(User[i].Password[j]=='O') User[i].Password[j]='o';
User[i].changed=true;
} }
} if(count>)
{
printf("%d\n",count);
for(i=;i<n;i++)
if(User[i].changed)
printf("%s %s\n",User[i].ID,User[i].Password);
}
else
{
if(n==) printf("There is 1 account and no account is modified\n");
else printf("There are %d accounts and no account is modified\n",n);
}
}
return ;
}
1035 Password (20)的更多相关文章
- PAT 甲级 1035 Password (20 分)(简单题)
1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for ...
- PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642
PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642 题目描述: To prepare for PAT, the judge someti ...
- 【PAT】1035. Password (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1035 分析:简单题.直接搜索,然后替换,不会超时,但是应该有更好的办法. 题目描述: To pre ...
- PAT甲级——1035 Password (20分)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...
- 1035 Password (20)(20 point(s))
problem To prepare for PAT, the judge sometimes has to generate random passwords for the users. The ...
- PAT Advanced 1035 Password (20 分)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...
- PAT (Advanced Level) Practice 1035 Password (20 分)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...
- 1035 Password (20分)(水)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...
- PAT甲题题解-1035. Password (20)-水
题意:给n个用户名和密码,把密码中的1改为@,0改为%,l改为L,O改为o. 让你输出需要修改密码的用户名个数,以及对应的用户名和密码,按输入的顺序.如果没有用户需要修改,则输出对应的语句,注意单复数 ...
随机推荐
- python(6)- shelve模块
前面学习了pickle,这两个可以将数据持久化存储到硬盘上,在实际应用中,我们可能会多次将数据dump到同一文件里,试一下: import pickle data = {'k1':123, 'k2': ...
- centos安装ftp
yum install -y vsftpd安装vsftpd service vsftpd start 启动vsftpd vim /etc/vsftpd/vsftpd.conf 将anonymous_e ...
- JMS笔记(二)
接上篇 JMS笔记(一),启动ActiveMQ后,打开http://127.0.0.1:8161/admin管理界面,用户名admin密码admin,点击上面的Queues菜单,创建一个q_test_ ...
- 【二进制】FZU 2062 Suneast & Yayamao
题意:给出n,问最少需要多少个数字,这些数字能组成1~n的所有数: 分析:n=1; 1; 1个 n=2; 1,1; 2个 1 = 1; 2 = 1+1; n=3; 1,2; 2个 1 = 1; ...
- hdu 2196 树形dp
思路:先求以1为根时,每个节点到子节点的最大长度.然后再次从1进入进行更新. #include<iostream> #include<cstring> #include< ...
- ListView使用自定义适配器的情况下实现适配器的控件点击事件执行Activity界面中的方法
如果ListView使用的是自定义的适配器,比如MyArrayAdapter extends ArrayAdapter<String> 那么,如何实现适配器中的点击事件执行activity ...
- 关于z-index的总结
z-index的作用 很多时候需要把一个元素覆盖到另一个元素之上,比如登入弹出框等,这个时候就需要z-index属性出场了.所以呢,z-index就是调节层的显示优先级,决定哪个显示在最上方.作用范围 ...
- jQuery选择器解释和说明
jQuery选择器的意义在于快速的找出特定的DOM元素,然后添加相应的行为. 基本选择器 //选择 id为 one 的元素 $('#btn1').click(function(){ $('#one') ...
- Ubuntu Linux 分区简易教程
关于Linux系统下的“分区”问题,对于新手来说一直是很头疼的.我来简单写一下,它的“分区”方法,规则. 声明:我为了让没有接触过Linux系统的人,理解更加简单.所以在言语表述上不是很规范,专业.我 ...
- 第三十一篇、iOS 9版本适配
1.网络适配(强制回退HTTP) 为了强制增强数据访问安全, iOS9 默认会把 所有的http请求 所有从NSURLConnection . CFURL . NSURLSession发出的 HTTP ...