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 ...
随机推荐
- web前端开发从0到1—html结构与常用标签
一:html文档标签结构 <html></html><!--文档片头信息,表示文档内容是用什么标签写的.--> <head></head>& ...
- 数据存储之归档解档 NSKeyedArchiver NSKeyedUnarchiver
在构建应用程序时,有一个重要的问题是如何在每次启动之间持久化数据,以便重现最后一次关闭应用前的状态.在iOS和OS X上,苹果提供了三种选择:Core Data.属性列表(Property List) ...
- Python 基础 Dict 和 Set 类型
python 什么是dict 例如: d = { 'Adam': 95, 'Lisa': 85, 'Bart': 59 } 我们把名称称为key,对应的成绩称为value,dic就是通过key 来查找 ...
- Web前端表单验证
表单选择器 :input(匹配所有input.textarea.select和button元素) :text(匹配所有单行文本框) :password(匹配所有密码框) :radio(匹配 ...
- 关于xib控件变成框框An internal error occurred
前段时间在进行系统适配的时候,由于在两个不同版本的Xcode之间进行了代码运行调试,导致回到老版本继续开发时xib里面所有的控件全部变成了蓝色的框框...真是哔了狗了 报错信息: an interna ...
- Fiddler无所不能——之测试开发攻城狮必备利器
Fiddler无所不能——之测试开发攻城狮必备利器 1.模拟真实网络环境4g网.3g网络.2g网络.弱网.请求超时 开启弱网Rules——Performance——勾选Simulate Modem S ...
- c语言智能指针 附完整示例代码
是的,你没有看错, 不是c++不是c#, 就是你认识的那个c语言. 在很长一段时间里,c的内存管理问题, 层出不穷,不是编写的时候特别费劲繁琐, 就是碰到内存泄漏排查的各种困难, 特别在多线程环境下, ...
- python的subprocess基本
先在同一个文件夹下创建两个.py文件. 第一个:13.py # -*- coding: utf-8 -*- __author__ = "YuDian" ''' multiproce ...
- Could not connect to '192.168.80.145' (port 22): Connection failed的解决办法(远程连不上xshell)
问题状况表现1 这个问题一般是你 的什么配置影响了虚拟机的网卡网关设置!!!. 问题状况表现2 这个问题一般是你 的什么配置影响了虚拟机的网卡网关设置. 解决办法 网上的那些解决方案,我都试过,比如. ...
- 20155322 2017-2018-1《信息安全系统设计》第二周 课堂测试 Linux下C语言实现MYOD
20155322 2017-2018-1<信息安全系统设计>第二周 课堂测试 Linux下C语言实现MYOD [博客目录] 静态库测试 实现方法 相关资料 操作 动态库测试 实现方法 相关 ...