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. 让你输出需要修改密码的用户名个数,以及对应的用户名和密码,按输入的顺序.如果没有用户需要修改,则输出对应的语句,注意单复数 ...
随机推荐
- 深入理解计算机系统第二版习题解答CSAPP 2.20
T2Uw(w)=x, x≥0时 T2Uw(w)=x+2w, x<0时 利用上面的公式,重新计算2.19的问题.
- python爬虫爬取全球机场信息
--2013年10月10日23:54:43 今天需要获取机场信息,发现一个网站有数据,用爬虫趴下来了所有数据: 目标网址:http://www.feeyo.com/airport_code.asp?p ...
- Oracle中exists与in的区别
有两个简单例子,以说明 "exists"和"in"的效率问题 1) select * from T1 where exists(select 1 from T2 ...
- CF Covered Path (贪心)
Covered Path time limit per test 1 second memory limit per test 256 megabytes input standard input o ...
- [未完成]关于GUI Java图形化界
"笔记内容完成,整体未完成" GUI 图形化用户界面 用java做图形化用户界面的程序不多,大多用C++和defy.因为,Java做图形化效率低. 首先你要安装一个虚拟机,C++是 ...
- hdu 4614 线段树
思路:当k为1的时候,用二分法查询包含有f个空瓶的上界r,然后更新会方便很多,直接更新区间(a,r)了. #include<iostream> #include<cstdio> ...
- zoj 2676 网络流+01分数规划
思路: 这题的结论得要看amber的论文,结论就是将求f(x)/b(x)最小转化为求min(f(x)-b(x)*λ),其中x为S集的解空间,f(x)为解的边权和,b(x)为解的边数, λ=f(x)/b ...
- fatal error LNK1168: cannot open Debug/opreat.exe for writing
问题:LINK : fatal error LNK1168: cannot open Debug/opreat.exe for writing Error executing li ...
- IE升级代码时邮件内容
TypeErrorUnable to set property 'value' of undefined or null reference. 但是可以进入添加页面,填完信息后,submit后跳转至 ...
- VSFTPD无法上传的解决方法
搭建好FTP之后就没有去测试了,今天去试了一下上传的时候发生错误了,无法上传,提示“553 Could not create file”错误, 上网找了一些资料,发现很多都说是权限和防火墙的问题,但是 ...