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 ...
随机推荐
- SSM项目引入文件失败
<mvc:resources mapping="/styles/**" location="/css/"/> <mvc:resources m ...
- Spring coud微服务框架具体实现关键说明
搭建一个微服务,考虑的问题涉及到运维,数据管理,性能,并发等方方面面.项目中使用Spring coud 搭建微服务,从技术选型,到技术实现都要全方面考虑服务化的问题.下面简单总结下搭建过程用的技术说明 ...
- js获取dom元素的子元素,父元素,兄弟元素小记
原生jsvar a = document.getElementById("dom"); del_space(a); //清理空格 var b = a.childNodes; //获 ...
- Ajax中异步与同步的区别
同步可以解决,只有前一个请求结束后,当前请求才会发起.
- PHP 判断密码强度
$score = 0; if(preg_match("/[0-9]+/",$str)) { ...
- 使用CURL实现GET和POST方式请求
/** 使用curl方式实现get或post请求@param $url 请求的url地址@param $data 发送的post数据 如果为空则为get方式请求return 请求后获取到的数据 */f ...
- Delphi Android USB Interface with the G2
来源:http://www.bverhue.nl/g2dev/?p=65 Delphi Android USB Interface with the G2 Leave a reply I first ...
- 【npm 指令】 (不定时持续更新)
查看webpack所有的版本及更多信息 npm info webpack 查看webpack所有的版本 npm info webpack versions 查看webpack最新的版本 npm vie ...
- IEC的PLC编程语言标准 IEC61131-3
IEC的PLC编程语言标准(IEC61131–3) 中有5种编程语言:1)顺序功能图(Sequential function chart) :2)梯形图(Ladder diagram):3)功能块图( ...
- Linux入门第五天——shell脚本入门(上)基本概念
一.什么是shell脚本 Shell 脚本(shell script),是一种为 shell 编写的脚本程序. 二.shell入门 1.先导知识 变量知识补充:https://www.cnblogs. ...