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. 让你输出需要修改密码的用户名个数,以及对应的用户名和密码,按输入的顺序.如果没有用户需要修改,则输出对应的语句,注意单复数 ...
随机推荐
- 接收POst数据流数据
var data = ""; using (StreamReader readStream = new StreamReader(context.Re ...
- Objective-C ,ios,iphone开发基础:picker控件详解与使用,(实现省市的二级联动)
第一步:新建一个单视图(single view)的工程, 命名为pickerTest,不要勾选下面两个选项,第一个是新版本里面的,第二个是单元测试,现在用不着. 点击next ->creat之 ...
- x264命令参数与代码中变量的对应关系
帧类型选项: -I/--keyint i_keyint_max 最大IDR帧间距,默认为250 -i/--min-keyint i_keyint_min 最小IDR帧间距,默认为25 --sce ...
- LeetCode 75
Sort Colors Given an array with n objects colored red, white or blue, sort them so that objects of t ...
- hdu 3622 二分+2-SAT判定
思路:如题 #include<iostream> #include<algorithm> #include<cstring> #include<cstdio& ...
- hdu3584 树状数组
思路:从一维扩展到三维.可以看看poj2155的解法. #include<iostream> #include<cstring> #include<algorithm&g ...
- HTML5와 CSS3 적용기
HTML5의 DTD 선언 <!DOCTYPE html> HTML5의 인코딩 선언 <meta charset="utf-8"> 그리고나서는 새로 ...
- Linux 命令 - rm: 删除文件和目录
命令格式 rm [OPTION]... FILE... 命令参数 -f, --force 强制删除,忽略不存在的文件,不会提示. -i, --interactive 没次删除文件时,提示用户确认. - ...
- SNMP监控一些常用OID的总结
做网络监控的人对SNMP的协议肯定够很熟悉,下面罗列出一些常见的OID说明,方便大家省去查阅相关资料的麻烦. 系统参数(1.3.6.1.2.1.1) OID 描述 备注 请求方式 .1.3.6.1.2 ...
- Contoso 大学 - 3 - 排序、过滤及分页
原文 Contoso 大学 - 3 - 排序.过滤及分页 目录 Contoso 大学 - 使用 EF Code First 创建 MVC 应用 原文地址:http://www.asp.net/mvc/ ...