1035 Password (20 分)(字符串)

注意下单复数
#include<bits/stdc++.h> using namespace std;
pair<string,string>pa;
int main()
{
int n;
scanf("%d",&n); vector<pair<string,string> >vec;
for(int i=;i<n;i++){
char a[],b[];
scanf("%s %s",a,b);
bool flag=false;
for(int j=;b[j];j++){
if(b[j]=='l'){
b[j]='L';
flag=true;
}
else if(b[j]==''){
b[j]='@';
flag=true;
}
else if(b[j]==''){
b[j]='%';
flag=true;
}
else if(b[j]=='O'){
b[j]='o';
flag=true;
}
}
if(flag) vec.push_back(make_pair(a,b));
}
if(vec.size()==){
if(n==) printf("There is %d account and no account is modified\n",n);
else printf("There are %d accounts and no account is modified\n",n);
} else{
printf("%d\n",vec.size());
for(int i=;i<vec.size();i++){
cout<<vec[i].first<<" "<<vec[i].second<<endl;
}
}
return ;
}
其实没必要用vector<pari<string,string>> 直接用vector<string> 即可 把空格也当成字符串放在一个字符串里
1035 Password (20 分)(字符串)的更多相关文章
- 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 ...
- 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 分)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem ...
- 【PAT甲级】1035 Password (20 分)
题意: 输入一个正整数N(<=1000),接着输入N行数据,每行包括一个ID和一个密码,长度不超过10的字符串,如果有歧义字符就将其修改.输出修改过多少组密码并按输入顺序输出ID和修改后的密码, ...
- 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 ...
- 1035 Password (20)(20 point(s))
problem To prepare for PAT, the judge sometimes has to generate random passwords for the users. The ...
- 1035 Password (20)
#include <stdio.h> #include <string.h> struct MyStruct { ]; ]; bool changed; }; int main ...
随机推荐
- 使用Docker遇到的基本命令及问题小结
当遇到Cannot connect to the Docker daemon. Is the docker daemon running on this host?导致Docker无法启动时,重启Do ...
- vue.js数组追加合并与对象追加合并的
今天在做懒加载的时候遇到的问题,在网上搜索找到的答案不是很清晰,就来写一下,方便以后使用. 直接上图吧 官方连接:https://cn.vuejs.org/v2/guide/reactivity.ht ...
- DG不同步,MRP0进程打不开
问题描述:主库备库之前正常连接,但是昨天磁盘空间满了之后,由于不知什么原因将备库重做日志删了,今天早上发现DG不同步的报警. 当时思路如下:1.通过select thread#,low_sequenc ...
- Mac python3连接mysql
Mac python3连接mysql 安装方法1: 1.pip3 install --upgrade pip //升级pip版本 2.sudo python3 /Library/Frameworks/ ...
- PHP连接mysql8.0出错“SQLSTATE[HY000] [2054] The server requested authentication method unknow.....
这个错可能是mysql默认使用 caching_sha2_password作为默认的身份验证插件,而不再是 mysql_native_password,但是客户端暂时不支持这个插件导致的. 解决方法一 ...
- MySQL无法启动重启竟是因为改了Linux主机名
MySQL无法重启.无法关闭.无法启动.无法使用,如果是因为修改了主机名,可以这样解决:关闭掉所有mysql进程,然后在启动一些mysql! 有时候,只要执行如下MySQL初始化命令即可解决:/usr ...
- 笔记:HTML5中input元素新增的type值
在HTML5中,input元素的type值增加了不少,使input的功能强大了很多. 但在各大浏览器中并不是所有的type值都支持. 以下是比较有用.并且浏览器支持的稍好一些的值: type=colo ...
- Redis(四):解析配置文件redis.conf
解析配置文件redis.conf目录导航: 它在哪 Units单位 INCLUDES包含 GENERAL通用 SNAPSHOTTING快照 REPLICATION复制 SECURITY安全 LIMIT ...
- Python--通过索引excel表将文件进行文件夹分类的脚本+读取指定目录下所有文件名的脚本
1.通过索引excel表将文件进行文件夹分类的脚本,此脚本由于将ip和id对应并生成对应id的文件夹将文件进行分类,也可以任意规定表格内容,通过vul_sc_ip.txt和xlsx文件进行索引. # ...
- spark 例子groupByKey分组计算2
spark 例子groupByKey分组计算2 例子描述: 大概意思为,统计用户使用app的次数排名 原始数据: 000041b232,张三,FC:1A:11:5C:58:34,F8:E7:1E:1E ...