【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 ...
随机推荐
- 如何创建Maven项目和Spring IOC例子
把如何创建Maven项目和创建Spring IOC的例子分享给大家,希望能对大家有帮助! 我的博客地址:https://www.cnblogs.com/themysteryofhackers/p/12 ...
- radhat 6.7修改mac地址方法
vi ifcfg-eth0 #HW……,即注释掉原硬件地址. 再自己照着原地址写:MACADDR="新mac地址" 重启
- CLI配置WLAN-PSK认证和802.1X认证
一.该部分配置主要是针对PSK认证 1.创建WLAN 2 2.让WLAN使用PSK的方式 config wlan create 2 OK OK //创建WLAN Profile Name和SSID ...
- Windows 10下一步一步创建 Scrapy框架的项目
此文是本人的学习笔记,网上搜索了很多资料,也走了一些弯路,记录下安装的过程,以便日后回顾 1.安装Anaconda3,安装时默认选项 2.装完Anaconda3后,打开系统变量在path路径下增加An ...
- 怎么拆分一个Excel工作簿中的多个工作表?
打开需要编辑的Excel文档.如图所示,工作簿下方有很多工作表.现在需要将这些工作表单独拆分开成一个个工作簿. 右键任意一个工作表标签,在弹出的下拉列表中选择查看代码.即弹出代码窗口.如下图所示. ...
- Windows下运行MapReduce程序出现Could not locate executable null\winutils.exe in the Hadoop binaries.
运行环境:windows10 64位,虚拟机:Ubuntu Kylin 14.04,Hadoop2.7.1 错误信息: java.io.IOException: Could not locate ex ...
- 06-Docker-Image管理操作
目录 06-Docker-Image管理操作 参考 镜像命名规范 镜像管理命令 1. 拉取推送 2. 查看操作 3. 本地删除 4. 创建标签 5. 导出导入 06-Docker-Image管理操作 ...
- iOS中的主要框架framework
在日常的iOS项目开发中,主要使用的就是Foundation和UIKit这两个框架. (一)Foundation框架 Foundation是对Core Foundation框架的一个封装,使用Foun ...
- UIImageView的API
- (instancetype)initWithImage:(UIImage *)image; 返回使用指定图像初始化的图像视图. - (instancetype)initWithImage:(UII ...
- border-1px的实现(stylus)如何在移动端设置1px的border
在这里我只介绍下边框的实现: 当样式像素一定时,因手机有320px,640px等.各自的缩放比差异,所以设备显示像素就会有1Npx,2Npx.为保设计稿还原度,解决就是用media + scale. ...