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. 让你输出需要修改密码的用户名个数,以及对应的用户名和密码,按输入的顺序.如果没有用户需要修改,则输出对应的语句,注意单复数 ...
随机推荐
- Recommended you 3 most popular Nissan pincode calculators
Have you still felt confused on how to choose a satisfactory Nissan pin code calculator in the marke ...
- TextFiled 中输入金额
要求: 输入的金额不能超过六位, 小数点后面只能输入两位小数 如果 textFIled 中第一位输入的是0 ,后面必须输入小数点,否则禁止输入 用到 textfiled代理方法 #pragma ma ...
- Android之Handler探索
Handler背景理解: Handler被最多的使用在了更新UI线程中,但是,这个方法具体是什么样的呢?我在这篇博文中先领着大家认识一下什么是handler以及它是怎么样使用在程序中,起着什么样的作用 ...
- ios数据缓存方法
转载自:http://zhidao.baidu.com/link?url=jNTz6lkL1way8bJ-WPY197Pe9aEM_ql-MZbVJsM5tXr7Mv82W70QQ5a9UlvhMMS ...
- Adobe Edge Animate –使用EdgeCommons加载和播放音频
Adobe Edge Animate –使用EdgeCommons加载和播放音频 版权声明: 本文版权属于 北京联友天下科技发展有限公司. 转载的时候请注明版权和原文地址. 在Edge中,可以new一 ...
- 关于Eclipse中校验输入文件名的源代码
Eclipse中测试文件名的方法. 也没有单独的分操作系统.在Talend时解决一个在文本框中输入名字有Bug的一个问题,这个是Eclipse中解决输入名字,对名字校验的部分源码. public IS ...
- Java Concurrency - ThreadLocal, 本地线程变量
共享数据是多线程应用最常见的问题之一,但有时我们需要为每个线程保存一份独立的变量.Java API 提供了 ThreadLocal 来解决这个问题. 一个 ThreadLocal 作用的例子: imp ...
- Linux 命令 - cd: 切换工作目录
命令格式 cd [directory] 实例 a) 将工作目录切换成主目录. cd # 或 cd ~ b) 将工作目录切换成当前工作目录的父目录. cd .. c) 将工作目录切换成上一个的工作目录. ...
- 注意java的对象引用
要注意,当前拿到的“对象引用”, 是不是 指向 最新的实例, 没有的话, 要重新 生成实例去指向. 代码例子: AnsweringRuleInfo bhRule = accountGenerator. ...
- KSImageNamed-Xcode插件在xcode 6.4/6.3或其他版本中不能使用解决方案
大家都知道这个插件很强大,但是现在这个插件最新版貌似只支持xcode7 ,需要修改KSImageNamed-xcode中的一个配置文件,添加uuid才能使他支持xcode6.3或6.4 进入下载的插件 ...