PAT 甲级 1035 Password(20 分)

NTPClock PC时间同步工具 立即下载

1035 Password(20 分)

To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O (o in uppercase). One solution is to replace 1 (one) by @, 0 (zero) by %, l by L, and O by o. Now it is your job to write a program to check the accounts generated by the judge, and to help the juge modify the confusing passwords.

Input Specification:

Each input file contains one test case. Each case contains a positive integer N (≤1000), followed by N lines of accounts. Each account consists of a user name and a password, both are strings of no more than 10 characters with no space.

Output Specification:

For each test case, first print the number M of accounts that have been modified, then print in the following M lines the modified accounts info, that is, the user names and the corresponding modified passwords. The accounts must be printed in the same order as they are read in. If no account is modified, print in one line There are N accounts and no account is modified where N is the total number of accounts. However, if N is one, you must print There is 1 account and no account is modified instead.

Sample Input 1:

3
Team000002 Rlsp0dfa
Team000003 perfectpwd
Team000001 R1spOdfa

Sample Output 1:

2
Team000002 RLsp%dfa
Team000001 R@spodfa

Sample Input 2:

1
team110 abcdefg332

Sample Output 2:

There is 1 account and no account is modified

Sample Input 3:

2
team110 abcdefg222
team220 abcdefg333

Sample Output 3:

There are 2 accounts and no account is modified
# include <iostream>
# include <string>
# include <map>
using namespace std;
const int maxn = 1050;
string s1[maxn];
string s2[maxn];

int main(){
//	freopen("C:\\1.txt", "r", stdin);
	int n, flag = 0, count = 0;
	string str1, str2;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		cin >> str1 >> str2;
		for(int i = 0; i < str2.size(); i++){
			if(str2[i] == '1'){
				str2[i] = '@';
				flag = 1;
			}
			else if(str2[i] == 'l'){
				str2[i] = 'L';
				flag = 1;
			} 
			else if(str2[i] == '0'){
				str2[i] = '%';
				flag = 1;
			} 
			else if(str2[i] == 'O'){
				str2[i] = 'o';
				flag = 1;
			} 
		} 
		if(flag){
			s1[count] = str1;
			s2[count] = str2;
			count++;
			flag = 0;
		}
	}
	if(!count) {
		if(n == 1) printf("There is 1 account and no account is modified\n");
		else  printf("There are %d accounts and no account is modified\n", n);
	}
	else{
		printf("%d\n", count);
		for(int i = 0; i < count; i++){
			cout << s1[i] << ' ' << s2[i] << endl;
		}
	}
	return 0;
} 

 

卫星通信链路预算实战:从EIRP到Eb/N0的完整计算指南(含Excel模板) 本文提供了一份卫星通信链路预算的实战指南,详细解析了从EIRP到Eb/N0的完整计算流程。文章重点对比了C波段与Ku波段在应对降雨衰减等动态因素时的不同策略,并分享了包含核心公式的Excel模板,帮助工程师将理论转化为可执行的系统设计依据。 阅读详情

相关推荐

基于大模型的恶性胸腔积液全周期预测与诊疗方案研究

本研究基于大模型技术构建了恶性胸腔积液全流程预测与诊疗体系,涵盖术前风险评估、术中方案优化、术后恢复预测及并发症预防。通过整合多源医疗数据,实现了手术风险概率预测(准确率80%)、并发症预警(AUC值0.85)及个性化康复方案制定,显著提升诊疗精准度。研究创新性地将Transformer架构与多模态数据融合,在100例临床验证中显示良好性能,但存在数据样本局限、模型可解释性不足等问题。未来将扩大多中心临床验证,优化算法可解释性,探索与基因检测等技术的结合应用,推动恶性胸腔积液的精准诊疗发展。

嵌入式毕设/课设资料清单(速查手册·文档模板·题库,持续更新)→ 见最新文章 1898

局域网ntp服务器设置(windows时间同步服务器NetTime)(ubuntu systemd-timesyncd ntp客户端)123端口、ntp校时、ntp同步(设置UDP入站流量绕过防火墙)

"pool.ntp.org"项目使用DNS轮询来分配各种时间服务器的流量,这意味着当你查询"pool.ntp.org"时,DNS服务器会返回该池中任意一个服务器的IP地址。这样,你就把你的Windows主机设为了NTP服务器。然而,如果你的网络不能访问互联网,那么你将无法使用这个地址,因为它需要通过互联网来访问NTP Pool的服务器。值4(二进制100)告诉W32Time服务,只有当本机是一个可靠的时间服务时(例如,它已经被配置为手动同步到一个硬件时钟或外部NTP服务器),才公布自己为时间服务器。

Dontla的博客 2万+

simulink可控励磁同步电机模型分析

他励同步电机模型分析

qq_26681609的博客 5552

win11指定时间服务器

点击 Internet 时间 ,更改设置,设置时间服务器的地址,保存并立即同步。点击时间和语言 >> 日期和时间。

不积跬步,无以至千里 5568

VMware ESXI 7.0实战:4T硬盘RAID1配置与性能调优全记录

本文详细记录了在VMware ESXI 7.0环境下,为Dell服务器配置两块4T硬盘组建RAID1并进行深度性能调优的全过程。文章重点解析了RAID控制器写入策略(Write-Back with BBU)、读取策略(Read-Ahead)的关键选择,并深入探讨了在ESXI虚拟机层面通过选用PVSCSI控制器、调整虚拟磁盘缓存策略(scsiX:Y.caching)等技巧,以最大化满足数据分析等IO密集型工作负载的需求,最终实现性能的显著提升。

gaochao的博客 259

初学者入门机器学习 (ML)的推荐教程

了解基本的机器学习概念并不难。有大量免费的在线博客文章、视频和编码教程可以引导您了解基础知识——从介绍性内容到常见应用程序,再到算法和应用技能。这篇文章总结了一些用于介绍 ML 的最佳免费选项。它按逻辑顺序排列,每个概念都建立在上一个概念的基础上。

u010542847的博客 4622

【一键校时】Ntp校时程序

软件功能:测试多个Ntp服务器延迟,进行校时操作,支持自定义Ntp服务器!

qq_67689815的博客 678

做蛋白组学数据分析,竟然还不会使用DIA-NN软件,走过路过不要错过,进来免费学习!!!

蛋白组学分析工具DIA-NN使用

wcy1995427的博客 9871

pat-1035 Password(20)(简单题,字符串处理)

  To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l...

欢迎访问方偲的博客 388

智能制造之物料详解

制造业业务系统中的物料流转贯穿需求、采购、生产到交付全流程,各系统协同实现精准追踪。需求阶段由CRM/ERP/PLM生成物料计划;采购入库阶段SCM/WMS/QMS完成采购质检;生产阶段MES/APS协调领料加工;成品交付阶段WMS/SCM处理出库物流。整个流程以BOM为蓝图,ERP为调度中心,通过数据联动实现物料状态、位置和数量的全链路可追溯。

cdfunlove的博客 656

【Matlab】刃边法计算mtf

摘要:刃边法是一种测量光学系统调制传输函数(MTF)的常用方法。本文介绍了基于Matlab的MTF计算实现方案,包括图像灰度化、梯度计算、刀口方向选择、梯度投影等关键步骤,并给出了完整的代码实现。该方案可通过添加图像预处理、多方向计算、函数封装等方式进行扩展,提高MTF计算的准确性和实用性,适用于不同应用场景的光学系统性能评估需求。(148字)

unber的博客 389

关于ntp校时软件windows版本-abouttime的介绍

关于ntp校时软件windows版本-abouttime的介绍 【下载地址】关于ntp校时软件windows版本-abouttime的介绍 AboutTime是一款经典的NTP校时软件,专为Windows系统设计,凭借其卓越的功能和高效性能,深受用户喜爱。它不仅支持作为校时客户端与互联网NTP服务器同步,还能在局域网中充...

gitblog_06717的博客 1004

如何跑通SuperPoint+LightGlue的训练代码使用gluefactory进行训练和评估?

🏆本文收录于专栏,主要记录项目实战过程中所遇到的Bug或因后果及提供真实有效的解决方案,希望能够助你一臂之力,帮你早日登顶实现财富自由🚀;同时,欢迎大家!持续更新中,up!up!up!!

**My Coding Family** 1786

PAT A 甲级 1035 Password (20分)

1036 Boys vs Girls (25分) 吐槽 我的VS中l和1是真的长得一模一样啊。要不是这题简单不用回头改代码,不然我怀疑自己会因为搞不清哪一段是关于l的哪一段是关于1的出错几次。 思路 C++的string里有快乐find函数,直接对四个字符循环搜索找到要替换的替换就行。 题目 This time you are asked to tell the difference betwee...

虚境的博客 414

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

【PAT 甲级】1035 Password (20 分)

1035Password(20分) To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distingu...

CrystalXueNing的博客 256

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

PAT甲级-1035 Password (20分)

点击链接PAT甲级-AC全解汇总 题目: To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distingui...

卷子的博客 382

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

Day56: [PAT甲级] 1035 Password (20分)

Day56: [PAT甲级] 1035 Password (20分) 题源: 来自PAT真题库: https://pintia.cn/problem-sets/994805342720868352/problems/994805454989803520 代码: dirty code凑合看吧 #include<iostream> #include<string> #incl...

qq2215459786的博客 195

【PAT甲级】1035 Password (20分)

解题过程的小记录,如有错误欢迎指出。 简单题,没时间可以不复习 小导航~题目分析注意点我的解题过程思路bug代码dalao的代码借鉴点 题目分析 注意点 我的解题过程 思路 bug 代码 dalao的代码 全部代码因版权原因不放出来,大家可以自行去柳神博客购买或者参考晴神的上机笔记~ 借鉴点 ...

SpicyChicken的自我修养 328

PAT 甲级 1035 Password (20分)

题目 1035 Password (20分) To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O

qq_41001689的博客 187

PAT 甲级 1035 Password (20 分)

1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distingu...

小渣渣的博客 301

PAT甲级 1035 Password (20分)

1035 Password (20分) 题目链接:PAT A 1035 题目大意:输入第一行给出一个正整数n,随后n行每行给出用户名和密码(均为不含空格的字符串)。要求统计含有1,0,l,O的字符串的个数,并且将1替换成@,将0替换成%,将l替换成L,将O替换成o。如果没有能够替换的,则输出题目要求输出的句子(如果n等于1,句子中的are应该改为is)。 思路分析:非常简单的一道题,只需要建立...

weixin_43684054的博客 176

PAT 甲级 1035 Password (20 分)

1035Password(20 分) To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard ...

aishenyan0793的博客 141

PAT甲级1035 Password (20 分)

1035Password(20分) To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distingu...

Dexter 179

PAT甲级 1035 Password (20 分) 题解

\quad字符串处理题,分别判断密码有没有需要修改的字符,按要求修改后统计修改的数量,然后就是按照要求输出即可。 #include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; string change(string ...

qq_40438165的博客 1438

PAT甲级---1035 Password (20 分)

PAT甲级—1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (zero) fr

weixin_44411458的博客 165

PAT 甲级 1035 Password (20 分)(简单题)

1035Password(20分) To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since ...

蔡军帅 388
上一篇: PAT 甲级 1033 To Fill or Not to Fill(25 分)
下一篇: 2018.9.8 第一次参加 PAT 甲级代码
UKnowNothing_
博客等级 码龄9年 58粉丝 106原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值