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;
} 

 

【制作100个unity游戏之30】使用unity实现一款2d俯视角RPG战斗游戏,主要使用InputSystem+有限状态机+A*寻路实现(完结,附带项目源码) 【制作100个unity游戏之30】使用unity实现一款2d俯视角RPG战斗游戏,主要使用InputSystem+有限状态机+A*寻路实现 阅读详情

相关推荐

AF驱动调试日志全解析:从配置到问题排查

本文全面解析AF驱动调试日志的配置、抓取与分析方法。从内核驱动与HAL层配置入手,确保日志正常输出,并详细解读开机初始化、马达识别、I2C通信等关键日志节点。通过多个实战案例,如对焦失败、前摄无功能、参数不生效及I2C报错等,系统性地展示了如何利用日志定位并解决AF对焦问题,是摄像头模组开发与调试的实用指南。

weixin_28285943的博客 305

局域网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万+

RLC电阻电容电感基础知识——电感篇

电感 等效电路 电感线圈由铜导线绕制,等效电路如图所示。 寄生电阻RS,包括了绕线电阻、引脚串联电阻以及磁芯损耗电阻三部分组成,其中绕线电阻与线径、长度、铜线电阻率有关;引脚电阻与引线长短、粗细有关;磁芯损耗电阻与磁芯材料特性有关,显然磁芯损耗电阻还与工作频率有关.寄生电容C主要是绕线圈与圈之间的杂散电容(为PF级),与绕线工艺有关。 等效导纳 显然: (1)当角频率ω(频率f)较小时,呈电感性. (2)当角频率ω等于ω0时,导纳Y虚部为0,呈现电阻性,即发生共振。令导纳Y虚部为0,即可求出共振角频率ω

azj2019的博客 1万+

win11指定时间服务器

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

不积跬步,无以至千里 5568

Unity URP炫彩干涉效果:从薄膜干涉原理到Shader Graph实现

薄膜干涉是一种常见的光学现象,指光在透明薄膜上下表面反射后产生干涉,形成彩虹色条纹。其原理基于光程差导致的相长与相消干涉,不同波长的光被选择性增强或削弱。在计算机图形学中,这一物理现象被抽象为高效的数学模型,通过Shader编程实现动态色彩变化,为游戏和实时渲染带来独特的视觉表现力。技术实现上,常采用正弦函数结合噪声纹理来模拟色彩循环,利用法线与视角点积作为基础变量,加入噪声扰动模拟厚度不均,实现随视角变化的虹彩效果。在Unity URP渲染管线中,可通过Shader Graph可视化工具或手写HLSL代码

weixin_34026997的博客 296

【MATLAB】嵌入式PID控制参数整定与优化

本文提出了一种基于MATLAB仿真的嵌入式PID参数优化方法,解决了传统人工试凑法效率低、适应性差的问题。通过建立一阶滞后被控对象模型,对比分析了不同PID参数组合的性能表现,筛选出最优参数。仿真结果表明,优化后的PID参数能有效降低超调量(从传统方法的显著超调降至接近0%),缩短调节时间,提高稳态精度。最终将优化算法部署到STM32平台,实现了"仿真整定-参数优化-嵌入式落地"的完整开发流程。该方法显著提升了嵌入式系统的响应速度和控制精度,为工业控制应用提供了标准化解决方案。

unber的博客 46

【一键校时】Ntp校时程序

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

qq_67689815的博客 678

i茅台最新任务python脚本

从固定的 `header_context` 生成HTTP请求头,并加入用户的`userId`、`MT-Token`等动态信息,以模仿真实的请求。- 发送预约请求,提交商品和门店的参数,如 `sessionId`、`shopId`、`itemId` 等。- 定时任务:通过 `cron` 表达式 `0 0 9/21 * * *`,表示每月的9日和21日的0点执行。- `login`:使用验证码进行登录,并返回 `token` 和 `userId`。- 获取北京时间当天0点的时间戳,作为预约请求的时间参数。

三维点云技术探索 983

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

AI Agent Harness与SCADA系统集成

简单来说,AI Agent Harness是Industrial AI Agent的“中央调度室+装备库+知识库+安全网”把不同技术栈、不同部署环境(云/边/端)、不同功能(感知、推理、决策、执行、验证)的“零散Agent”组装成具备特定工业场景能力的Agent Team(如聚合反应根因诊断Agent Team);管理Agent Team的生命周期(创建、初始化、调度、监控、销毁);提供统一的工业多工具调用接口(对接SCADA、MES、PLC、DCS、巡检机器人、数字孪生平台等);内置。

欢迎来到我的优快云空间!这里聚焦AI大模型应用实战,分享前沿技术、实战案例与开发经验。 355

YOLO11多类别数据集的类别平衡方法:讲解类别不平衡问题的识别方法,以及过采样、欠采样、类别权重调整等解决方案(一)

类别不平衡问题是机器学习和计算机视觉领域中一个常见但棘手的挑战。简单来说,当数据集中不同类别的样本数量存在显著差异时,我们就称这个数据集存在类别不平衡问题。在YOLO目标检测任务中,这意味着某些类别的目标对象在训练数据中出现得非常频繁,而其他类别的目标对象则很少出现。 想象一下,你正在训练一个交通监控系统,需要检测不同类型的车辆。在这个场景中,"汽车"这个类别可能有成千上万个实例,而"自行车"或"摩托车"可能只有几百个实例。这种数量上的巨大差异就是典型的类别不平衡问题。 从数学角度来看,假设我们有一个包

本博客聚焦 YOLOv11 全流程落地,涵盖架构优化、数据集处理、训练技巧与多场景部署,兼及国产数据库、Java 开发与 AI 模型应用,内容兼顾理论与工程实践,为开发者提供系统干货,助力高效提升技术能力。 940

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

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

gitblog_06717的博客 1004

ARFoundation系列讲解 - 手部跟踪编程

通过使用ARFoundation的手部跟踪子系统,我们可以轻松地在AR应用程序中实现与用户手部的交互。通过设置AR环境、创建场景和相机、添加手部跟踪功能以及编写相应的脚本,我们可以开始在AR场景中跟踪和操作用户的手部。在Unity中创建一个新场景,并将AR Session组件添加到场景中的一个空对象上。手部跟踪的具体实现可能因AR设备和平台的不同而有所差异,你可能需要根据你的使用情况进行一些适配和调整。当你将手部放入AR场景中时,手部跟踪系统将触发相应的事件,并调用脚本中的回调函数。

2301_79325339的博客 355

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

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

【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

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

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

IEM模型,地表粗糙度模拟

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

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、付费专栏及课程。

余额充值