【PAT甲级】1035 Password (20 分)
题意:
输入一个正整数N(<=1000),接着输入N行数据,每行包括一个ID和一个密码,长度不超过10的字符串,如果有歧义字符就将其修改。输出修改过多少组密码并按输入顺序输出ID和修改后的密码,如果没有修改过就输出There are N accounts and no account is modified。(根据样例如果N==1,are改成is并且accounts不加s)
AAAAAccepted code:
#define HAVE_STRUCT_TIMESPEC
#include<bits/stdc++.h>
using namespace std;
char s[][];
char x[][];
int ans[];
int main(){
int n;
cin>>n;
int cnt=;
for(int i=;i<=n;++i){
cin>>x[i];
cin>>s[i];
int flag=;
for(int j=;s[i][j]!=;++j)
if(s[i][j]=='')
s[i][j]='@',flag=;
else if(s[i][j]=='')
s[i][j]='%',flag=;
else if(s[i][j]=='l')
s[i][j]='L',flag=;
else if(s[i][j]=='O')
s[i][j]='o',flag=;
if(flag)
ans[++cnt]=i;
}
if(!cnt&&n==)
cout<<"There is "<<n<<" account and no account is modified";
else if(!cnt&&n>)
cout<<"There are "<<n<<" accounts and no account is modified";
else{
cout<<cnt<<"\n";
for(int i=;i<=cnt;++i)
cout<<x[ans[i]]<<" "<<s[ans[i]]<<"\n";
}
return ;
}
【PAT甲级】1035 Password (20 分)的更多相关文章
- PAT 甲级 1035 Password (20 分)(简单题)
1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for ...
- PAT甲级——1035 Password (20分)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...
- 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 分) 凌宸1642
PAT (Advanced Level) Practice 1035 Password (20 分) 凌宸1642 题目描述: To prepare for PAT, the judge someti ...
- PAT 甲级 1035 Password (20 分)
1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for th ...
- PAT 甲级 1077 Kuchiguse (20 分)(简单,找最大相同后缀)
1077 Kuchiguse (20 分) The Japanese language is notorious for its sentence ending particles. Person ...
- PAT 甲级 1061 Dating (20 分)(位置也要相同,题目看不懂)
1061 Dating (20 分) Sherlock Holmes received a note with some strange strings: Let's date! 3485djDk ...
- PAT (Advanced Level) Practice 1035 Password (20 分)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...
- 【PAT】1035. Password (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1035 分析:简单题.直接搜索,然后替换,不会超时,但是应该有更好的办法. 题目描述: To pre ...
随机推荐
- 金中宝POS
金中宝POS机刷卡到账时间:9:00-22:00 现代金控自选商户POS机注意事项 选择: 1 消费 T+1到账(下一个工作日到账) 选择: 2 订单支付 是实时到账! 一.金中宝POS机秒到时间:2 ...
- springboot+mybatis报错Invalid bound statement (not found)
今天做项目时报了一个错提示说Invalid bound statement (not found),也就是说mapper接口绑定.xml文件出错了,找不到指定的sql:原因是程序没有把.xml文件编译 ...
- vue使用过程中遇到的细节问题
1. 在methods 中添加一个方法.如果这个方法使用箭头函数的话,箭头函数中的this不是当前的vue实例,所以通过this.xxx是获取不到实例上面的属性的,这时我们可以用函数的简写来获取到实例 ...
- springboot 框架 - helloword
功能:浏览器发送hello请求,服务器接收请求并处理,返回hello word字符串 一.创建一个maven项目 二.在pom.xml文件中添加依赖导入springboot框架运行需要的依赖 < ...
- VMware安装ACS5.8
1.所需组件: VMware ACS5.8 iso 2.安装要求: 2 Core Processor 4 GB RAM 60 GB Hard drive 这些要求算是比较低的要求,不能比这个更low了 ...
- MFC程序加打印(使用控制台)
对于MFC界面编程,在调试过程常常希望时刻知道程序的运行状态,可以使用弹窗程序来进行显示,但这种操作非常的麻烦,因此可以考虑使用控制台程序,在控制台程序中添加输出信息.方法如下: 在stdafx.cp ...
- ES-Result window is too large
问题: Result window is too large 解决: PUT http://127.0.0.1:9200/catalog/_settings { "index": ...
- Laravel Vuejs 实战:开发知乎 (8)美化编辑器
1.使用UEditor增量包: simple-ueditors 执行下载: git clone https://github.com/JellyBool/simple-ueditor.git 2.用此 ...
- Jekyll本地搭建开发环境以及Github部署流程
转载自: http://www.jianshu.com/p/f37a96f83d51 前言 博客从wordpres迁移到Jekyll上来了,整个过程还是很顺利的.Jekyll是什么?它是一个简单静态博 ...
- 【Python与线程】
" 目录 一.全局解释器锁GIL 二.Python线程模块的选择 三.线程的创建 三.锁机制 四.信号量 五.事件 六.条件 七.定时器 八.线程队列 九.线程池 补充:线程安全 imp ...