1035 Password

计算机组成原理汉字编码与校验设计实验报告(汉字国标码转区位码实验、汉字机内码获取实验、海明编码电路设计与海明解码) 这次实验利用logisim进行设计,进行了以下这四个实验,其中分为汉字国标码转区位码实验、汉字机内码获取实验、海明编码电路设计与海明解码,实验报告分为四个部分,在这四个部分中依次对四个实验的方案设计,设计思路进行了介绍 阅读详情

1035 Password (20 point(s))

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 Oby 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 Mlines 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>
using namespace std;
int modified = 0;
bool mark[1001];
struct record{
	string user,passwd;
};
record r[1001];
bool judge(string &input){
	bool flag = false;
	for(int i=0;i<input.length();i++){
		if(input[i]=='1'){
			input[i]='@';flag=true;
		} 
		if(input[i]=='0'){
			input[i]='%';flag=true;
		}
		if(input[i]=='l'){
			input[i]='L';flag=true;
		}
		if(input[i]=='O'){
			input[i]='o';flag=true;
		}
	}
	if(flag) modified++;
	return flag;
}
int main(void){
	int M;cin>>M;
	for(int i=0;i<M;i++){
		mark[i]=false;
		cin>>r[i].user>>r[i].passwd;
		if(judge(r[i].passwd)) mark[i]=true;
	}
	if(modified!=0){
		cout<<modified<<endl;
		for(int i=0;i<M;i++){
			if(mark[i]) cout<<r[i].user<<" "<<r[i].passwd<<endl;
		}
	}
	else{
		if(M==1) cout<<"There is 1 account and no account is modified"<<endl;
		else cout<<"There are "<<M<<" accounts and no account is modified"<<endl;
	}
	return 0;
}

 

图文实录|大规模预训练模型:探讨与展望 第二期「澜舟分享会」我们邀请到来自复旦大学计算机学院邱锡鹏教授分享了“大规模预训练模型:探讨与展望”,本此演讲主要围绕大规模预训练语言模型展开讨论,并探讨大模型成功的原因、适用场景、未来发展方向以及身处大模型时代我们的机遇。 阅读详情

相关推荐

Mcgs 屏幕Modbus RTU通讯调试

昆仑通态屏幕作为Modbus Master 与 Modbus Slave通过RS485接口实现通信的调试记录

madao1234的博客 5575

【PAT甲级】1035 Password

题目链接:1035Password #include <iostream> #include <vector> using namespace std; struct user{ string name, passwords; }; int main(){ int n; cin >> n; vector<user> ans; for(int i = 0; i < n; i++){ st..

五百零一 122

告别手动!用Python+CATIA V5/V6自动生成三视图和标题栏(附完整代码)

本文详细介绍了如何利用Python和CATIA V5/V6实现工程图自动生成,包括三视图布局和标题栏填写。通过COM接口调用和智能算法,系统能自适应不同尺寸模型,大幅提升设计效率。附完整代码和部署方案,帮助团队实现从手动到自动化的转变。

weixin_42699679的博客 354

1035 Password

1035 Password解题代码测试结果问题整理 解题代码 #include<cstdio> #include<cstring> struct password { char name[11]; char word[11]; bool flag; }p[1000]; int main() { int num, cnt = 0; scanf("%d", &num); for (int i = 0; i < num; i++) { p[i].flag =

Aruasg的博客 182

SAP 屏幕增强:客户商主数据屏幕增强(KNA1、KNB1、KNVV)

本文介绍了SAP系统中针对客户主数据(KNA1、KNB1、KNVV)进行屏幕增强的具体实现方法。主要内容包括:1)在SPRO配置中创建新条目;2)通过SE80创建函数组和程序(LZKNA1TOP等);3)设置子屏幕9001并添加自定义结构字段;4)利用BADI(CUSTOMER_ADD_DATA等)实现数据交互逻辑。文章分别详细说明了针对客户主数据的一般数据(KNA1)、公司代码数据(KNB1)和销售数据(KNVV)三类不同数据的增强配置步骤,包括函数模块创建、屏幕设置和BADI方法调用等关键技术点。

SAP ABAP开发技能记录分享 1619

dummy机械臂代码学习(六)

CLI-Tool文件夹下又包含四个子文件夹,以及一个gitignore文件、一个run_shell.py的python文件、一个run.bat文件和一个zadig exe文件。库解析命令行参数,并根据不同的命令执行相应的操作。Zadig是一个用于Windows操作系统的开源工具,它的主要功能是安装和配置USB驱动程序。的目的呢就是确保在版本控制过程中,不必要的或自动生成的文件被忽略掉,来保持代码仓库的干净和整洁。,DummyStudio的软件作者已放在GitHub,我们主要看CLI-Tool文件夹就行。

jumaohhh的博客 1434

字符串—PAT 1035 Password

字符串—PAT 1035 Password 题目代码 题目 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)

苏苏和柚子 170

fragstats:景观指数趋势分析

优快云@_养乐多_本文将介绍景观指数时间序列的趋势分析,包括趋势类型、斜率、截距等。以及景观指数突变分析所用的软件和 python 代码。结果如下图所示,

养乐多的博客 2861

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

YOLO26 实例分割技术:Mask 分支与特征融合

YOLO26实例分割技术研究摘要:本文提出了一种基于YOLO架构的高效实例分割方法,通过创新设计Mask分支和特征融合策略解决像素级分割精度、多尺度目标处理等挑战。系统采用共享Backbone提取特征,检测分支输出边界框和类别,Mask分支生成原型Mask和组合系数。核心创新包括:1)原型Mask生成与线性组合机制;2)检测与Mask特征共享;3)结合BCE和Dice的多任务损失函数。实验表明该方法在保持实时性的同时实现了高质量分割,为轻量级实例分割提供了新思路。

一键难忘的博客 250

15、人工智能社会学:关系视角下的机器相遇

本文探讨了将人工智能视为社会主体的可能性,提出了一种关系视角下的人工智能社会学。通过结合卢西亚娜·帕里西、艾伦·图灵和乔治·赫伯特·米德的理论,强调不确定性在人工智能运行中的核心地位,并分析了人工智能如何通过与社会环境的互动催生新奇性,从而拓展社会学的研究范畴。文章还讨论了人工智能对社会结构和社会互动的影响,以及其作为社会主体所带来的理论和实践意义,为未来人工智能社会学的发展提供了方向。

pea55的博客 73

PAT甲级-字符串处理类型-1035 Password解题思路

1035 Password (20 分) 思路 使用string类型的find和replace秒杀,而不需要使用繁琐的char数组 string类型在确定字符串内是否有某元素,替换某元素时使用 char类型数组在变换数组时才使用,并且要记得后面置’\0’ 下面给出string类型的replace函数和find函数的具体使用,replace必须存在有被替换的符号才可以使用,否则报错。 int main() { string a, b, c; cin >> a >> b

weixin_43999137的博客 250

Python FastAPI 面试题及参考答案

FastAPI 的路由机制是其核心功能之一,用于将不同的 URL 路径映射到相应的处理函数。通过定义路由,可以构建出功能丰富的 API。在 FastAPI 中,使用装饰器来定义路由。在这个示例中,是一个装饰器,它将根路径"/"的 GET 请求映射到read_root函数。当客户端发送一个 GET 请求到根路径时,FastAPI 会调用read_root函数并返回结果。

大模型大数据攻城狮的专栏 2248

PAT (Advanced) 1035. Password (20)

原题:1035. Password (20)解题思路:按题意进行即可,注意一个陷阱:样例在没有修改时n = 1与n &gt; 1输出不同即可。代码如下:#include&lt;cstdio&gt; #include&lt;algorithm&gt; #include&lt;cstring&gt; using namespace std; const int maxn = 1000 + 5; str...

吹风的四月 162

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

A1035 Password (20分)

A1035 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) f

qq_45735298的博客 202

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

1035. Password

http://pat.zju.edu.cn/contests/pat-a-practise/1035 // #include #include #define SIZE 15 #define MAXSIZE 1000+5 void replace(char a[], char b[]) { int i=0; while(a[i] != 0) { switch(a[

Sunshine 776

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

PAT-1035 Password

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 disti...

suxiaorui的博客 312

1035 Password java

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 distinguish1(one) froml(L...

有梦的博客 222

1035.Password (20)

pat-al-10352017-01-26 注意一下输出 /** * pat-al-1035 * 2017-01-26 * C version * Author: fengLian_s */ #include<stdio.h> #include<string.h> struct STU { char name[12]; char password[12]; }; int main(

一剑钦安 573

PATA1035 Password

1035 Password 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 distinguish1(...

沧夜的成长日记 796
上一篇: 1024 Palindromic Number
下一篇: 1065 A+B and C (64bit)
coderwait
博客等级 码龄9年 20粉丝 210原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值