pat1035Password (20)

从仿真到流片:手把手教你优化65nm CMOS电荷泵的电流匹配与稳定性 本文详细介绍了在65nm CMOS工艺下优化电荷泵电流匹配与稳定性的工程实践指南。通过蒙特卡洛仿真、运放反馈结构版图技巧和全差分结构设计,实现优于1%的电流匹配精度和±2%以内的电流稳定性,特别针对current mismatch问题提供了有效的解决方案。 阅读详情

题意分析:

(1)给出若干个PAT考试登陆账户,为了防止账户密码中有个别引起混淆的字母和数字(l,1,O,0),统计密码中出现可能混淆的字母的账户个数,并将修改后的账户按原来的顺序输出

可能坑点:

(1)注意:当没有出现混淆字母的账户时候,如果原来有N条记录,则要区分N=1和N!=1时候,输出结果的account和accounts单复数之别

(2)注意,在G++的编译器当中,当使用cout输出流的时候,cout<<"There are “<<N<<”...“<<endl;是错误的,一旦使用了这样的输出方式,会导致第二个测试案例过不去

#include <iostream>
#include <string.h>
#include <vector>
#include <stdio.h>
using namespace std;

struct userInfo
{
    string userName,passWord;
};
vector<userInfo>accounts;
bool check(string &passWord)
{
    bool isModified=0;
    for(int i=0;i<=passWord.length();i++)
    {
        if(passWord[i]=='1')
        {
            isModified=1;
            passWord[i]='@';
        }
        else if(passWord[i]=='0')
        {
            isModified=1;
            passWord[i]='%';
        }
        else if(passWord[i]=='l')
        {
            isModified=1;
            passWord[i]='L';
        }
        else if(passWord[i]=='O')
        {
            isModified=1;
            passWord[i]='o';
        }
    }
    return isModified;
}
int main()
{
    int N,i=0,cnt=0;
    scanf("%d",&N);
    string userName,passWord;
    userInfo temp;
    while(i<N)
    {
        cin>>userName>>passWord;
        if(check(passWord))
        {
            cnt++;
            temp.userName=userName;
            temp.passWord=passWord;
            accounts.push_back(temp);
        }
        i++;
    }
    if(cnt==0)
    {
        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
    {
        cout<<cnt<<endl;
        vector<userInfo>::iterator it=accounts.begin();
        for(;it!=accounts.end();it++)cout<<(*it).userName<<" "<<(*it).passWord<<endl;
    }
    return 0;
}


交换机端口模式详解:Access、Hybrid、Trunk 交换机是网络中至关重要的组件之一,用于连接各种设备并启用数据的高效流动。为了更好地管理和控制网络流量,交换机提供了不同的端口模式,其中包括Access、Hybrid和Trunk。本文将深入探讨这三种端口模式,详细解释它们的配置、特性和应用场景,以帮助网络管理员更好地理解和优化网络架构。 阅读详情

相关推荐

四旋翼黑科技揭秘:如何利用PX4隐藏的角加速度数据提升控制性能

本文深入探讨了如何利用PX4飞控中隐藏的角加速度数据,结合增量非线性动态逆(INDI)控制方法,显著提升四旋翼无人机的控制性能。通过实战教程,指导开发者从数据订阅、INDI原理到代码实现,构建响应更快、鲁棒性更强的控制回路,有效应对突风与快速机动。

lake5的博客 721

1035 Password (20 分) 全网最细 题目详解 翻译 完整代码 PAT甲级真题解析

1035 Password (20 分) 本道题需要了解的预备知识: 中文翻译:(原题目为英文) 为了准备PAT,裁判有时候需要为用户生成随机密码。但是有些字符却难以区分,例如:‘1’(数字1)和’l’(字母L小写),‘0’(数字0)和’O’(字母o大写)。其中一种解决方案是用’@‘代替’1’(数字1),用’%‘代替’0’(数字0),用’L’(字母L大写)代替’l’(字母L小写),用’o’代替’O’(字母o大写)。现在你的任务是编写一个程序来检查自动生成的密码,并帮助裁判修改这些某些难以区分的密码。 输

BBBling的博客 753

AWR1642+DCA1000EVM 不使用mmWave Studio软件采集原始ADC数据 Timeout问题汇总

DCA1000 EVM Timeout问题汇总

Jesy_Hsu的博客 1476

1035 Password(字符串处理)

这类题目几乎不需要数据结构,算法基础,主要通过简单的逻辑流程和判断实现。 题目描述如下: 大致题意: 首先输入一个整数N(<=1000),紧接着输入N行数据,每行数据包括用户名和密码,之间用空格进行分割,如果密码包含”0“,”1“,”l“,”O“,则把零转换成%,把一转换成@,把小写l转换成大写L,把大写O转换成小写o。 输出有多少个用户名的密码进行了转换,并且按顺序输出转换后的用户名和密码。 如果都没进行转换,则输出”There is N account and no account is mo

weixin_44046769的博客 575

Windows 下安装 ros2 的超详细教程

Windows11 ROS安装

2401_83363439的博客 3319

AI应用架构师干货:智能财务分析AI平台可视化模块设计(附最佳实践)

智能财务分析的价值,从来不是“AI模型有多准”,而是“财务人员能用上AI的结果”。可视化模块的设计,本质是**“站在业务用户的角度,重新定义技术的价值”**——它不需要复杂的动画,不需要华丽的特效,只需要“把AI的结果翻译成财务人员能看懂的语言”。作为AI应用架构师,我们的使命不是“打造最先进的技术”,而是“打造最有用的技术”。而可视化,就是连接技术与业务的那座“桥”。附录:实战项目GitHub仓库(注:此处可放置实际项目的GitHub链接,包含完整代码、数据样例、部署文档)作者简介。

SuperAGI2025 1156

PAT A1035 Password 三个经验仔细看!

//经验1:如果遇到20分的题,有5分两个点没有通过,不要担心,细心一点复查,仔细对输入输出;仔细考虑特殊情况,你可以的,不要慌 //经验2:if else语句还是写完整,每种情况不要偷懒 //经验3:测试每一个给出的点,每个测试点都值很多分。与其多做,不如把一题分拿满。考虑周全就好了的。最后一个3分没通过的点,通过调试了最后一个给出的case,发现多输出了0,于是才知道自己if else考虑不

小青青的技术之家 776

RK3568 解决MIPI屏幕开机只显示uboot logo的问题

之前写过一篇文章介绍了RK3568驱动MIPI屏幕的方法,这次产品迭代,硬件改版,选型的新的屏幕了。所以再次开启调试屏幕的过程。本以为会和上次一样会轻车熟路,事情总是事与愿违,同样的路,遇到新的坑。

fhqlongteng的博客 5426

PAT甲级真题 1035Password (20) 通行密码

首先,先贴柳神的博客 https://www.liuchuo.net/ 这是地址 想要刷好PTA,强烈推荐柳神的博客,和算法笔记 文章目录题目原文Input Specification:Output Specification:Sample Input 1:Sample Output 1:Sample Input 2:Sample Output 2:Sample Input 3:Sample Ou...

Huangpengyu123的博客 413

Copula函数实战:如何用MATLAB计算气象干旱与农业干旱的联合概率?

本文提供了一份基于MATLAB的Copula函数实战指南,详细阐述了如何利用该多变量联合分布函数计算气象干旱与农业干旱的联合概率及条件概率。通过从数据预处理、边缘分布拟合到Copula模型选择与检验的完整流程,帮助环境科学与农业气象研究者量化干旱事件的关联风险,为风险评估提供定量依据。

weixin_29213655的博客 431

dify安装ollama插件及OLLAMA模型添加失败问题完整解决方法

plugin_daemon-1 | 2025/05/10 17:37:36 stdio.go:160: [INFO]plugin langgenius/ollama:0.0.6: Installed model: ollama 提示ollama安装成功,再添加模型就不会有问题了。安装dify1.2.0和1.3.1均出现OLLAMA插件安装失败或插件安装后添加模型失败的问题,具体表现为一是添加ollama插件时没反应,需要二次添加才成功;二是添加模型时点保存报500错误或点保存后没反应,无法成功添加。

symstandsun的博客 9078

1035 Password(20分)

对字符串中容易混淆的字符进行替换,并按照指定顺序(和输入顺序一致)和格式(is、are、account单数或者复数)输出。测试点2:是因为没有考虑格式(is、are、account单数或者复数)输出,具体见后两个样例。还有一个就是unorder_map并不能保证和输入顺序一致。

a131529的博客 185

【AI智能体】Dify集成 Echarts实现数据报表展示实战详解

Dify集成 Echarts 实现智能数据报表集成与展示实战详解

congge 5962

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

devon2014的博客 139

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

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

peanWang的博客 176

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

PAT 1035 Password (20)

1035 Password (20)(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 dist...

ryo_218的博客 160

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

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

dengkonglou4529的博客 139

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

PAT 1035 Password(20分)

字符串

cwtnice的博客 911

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 distin

R11happy的博客 460

【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

1035. Password (20)-PAT

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

兵临城下 916

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

小木匠QvQ 475

PAT-A 1035 Password (20 分)

思路:水题,直接做。

qq_38127801的博客 251

pat 1035 Password (20分)

字符串模拟题: 注意提议就好了 #include <iostream> using namespace std; #include <vector> int main() { int m; cin >> m; string id, pwd; vector<string> p, I; int cnt = 0; while(m--) { bool flag = false; //记录.

weixin_44110100的博客 236
上一篇: pat1034Head of a Gang (30)
下一篇: pat1036Boys vs Girls (25)
LostStephon
博客等级 码龄11年 14粉丝 59原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值