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 ...
随机推荐
- Linux系统调用原理
操作系统通过系统调用为运行于其上的进程提供服务. 当用户态进程发起一个系统调用, CPU 将切换到 内核态 并开始执行一个 内核函数 . 内核函数负责响应应用程序的要求,例如操作文件.进行网络通讯或者 ...
- CORS跨域实现思路及相关解决方案
本篇包括以下内容: CORS 定义 CORS 对比 JSONP CORS,BROWSER支持情况 主要用途 Ajax请求跨域资源的异常 CORS 实现思路 安全说明 CORS 几种解决方案 自定义CO ...
- iOS之在本地搭建IPv6环境测试你的app
IPv6的简介 IPv4 和 IPv6的区别就是 IP 地址前者是 .(dot)分割,后者是以 :(冒号)分割的(更多详细信息自行搜索). PS:在使用 IPv6 的热点时候,记得手机开 飞行模式 哦 ...
- POJ2311 Cutting Game(博弈论)
总时间限制: 1000ms 内存限制: 65536kB 描述 Urej loves to play various types of dull games. He usually asks other ...
- Centos 下 mysql 安装过程
1. 检查系统自带的Mysql,并卸载自带的版本 [root@iZ2366ycl7sZ config]# yum list installed |grep mysql mysql.x86_64 5.1 ...
- windows下开启 PHP扩展Redis
Redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted set ...
- python学习——简介和入门
一.Python简介: Python的创始人为吉多·范罗苏姆(Guido van Rossum).1989年的圣诞节期间,吉多·范罗苏姆为了在阿姆斯特丹打发时间,决心开发一个新的脚本解释程序,作为AB ...
- Wtrofms
一.安装 安装:pip3 install wtforms 二.使用1(登录) from flask import Flask, render_template, request, redirect f ...
- hive 优化 (转)
Hive优化 Hive优化目标 在有限的资源下,执行效率更高 常见问题 数据倾斜 map数设置 reduce数设置 其他 Hive执行 HQL --> Job --> Map/Reduce ...
- Python学习笔记十:json序列化,软件结构目录规范,ATM作业讲解,import本质论
json序列化 将系统的某个状态保存为字符串(挂起),序列化. import json json.dumps():序列化 json.loads():反序列化 简单类型数据处理 import pickl ...