Poj1298_The Hardest Problem Ever(水题)

【阿里云大模型高级工程师ACP习题集】2.7 通过微调增强模型能力 (下篇)(⭐️⭐️⭐️ 重点章节!!!) 【摘要】这是我精心整理出对应的习题集,里面足足有 30 道题目,从基础概念到深度拓展,全方位覆盖章节重点、难点。不管你是想检验自己的学习成果,还是想针对薄弱环节进行强化训练,它都能完美适配! 阅读详情

一、Description

Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of the first ciphers. This cipher was so incredibly sound, that no one could figure it out without knowing how it worked.
You are a sub captain of Caesar's army. It is your job to decipher the messages sent by Caesar and provide to your general. The code is simple. For each letter in a plaintext message, you shift it five places to the right to create the secure message (i.e., if the letter is 'A', the cipher text would be 'F'). Since you are creating plain text out of Caesar's messages, you will do the opposite:
Cipher text
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Plain text
V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
Only letters are shifted in this cipher. Any non-alphabetical character should remain the same, and all alphabetical characters will be upper case.

Input

Input to this problem will consist of a (non-empty) series of up to 100 data sets. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets. All characters will be uppercase.
A single data set has 3 components
  1. Start line - A single line, "START"
  2. Cipher message - A single line containing from one to two hundred characters, inclusive, comprising a single message from Caesar
  3. End line - A single line, "END"
Following the final data set will be a single line, "ENDOFINPUT".

Output

For each data set, there will be exactly one line of output. This is the original message by Caesar.
二、问题分析
        最近两天,哥们被三伏天折磨的想死的心都有了。于是乎,我决定找几道水题来降降温。这道号称是“史上最难的问题”的题目就是一道标准的水题。
        题目很简单,密码转译问题。开始的时候以为是加密,这也算是我所唯一检查了的地方。用字符串存放输入,然后把字符串转换为字符数组。把字母分为两部分,A~F字符转换为Ascii码后加21,G~Z转换为AscII后减5。遍历每个字符,按上面的规则改变字母。
        刚刚看到网友爆料,此题居然和3749一样。我还以为是和它一样水呢,没想到是一样的题,不过3749是中文的。哎呀,还省了翻译的时间,要知道水题最难之处就是翻译啊!!!
三、Java代码
     
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader read=new BufferedReader(new InputStreamReader(System.in));
		while(!read.readLine().equals("ENDOFINPUT")){
			String s=read.readLine();
			char[] c=s.toCharArray();
			for(int i=0;i<c.length;i++){
			    int a=(int)c[i];
			    if(a>= 70 && a<=90){
			    	c[i]=(char) (c[i]-5);
			    }else if(a>=65 && a<=69){
			    	c[i]=(char) (c[i]+21);
			    }
			}
			System.out.println(c);
			read.readLine();
		}
	}
}



STM32C8T6HAL库实战:MAX30102心率血氧检测与OLED多级菜单一体化方案 本文详细介绍了基于STM32C8T6和HAL库的MAX30102心率血氧检测与OLED多级菜单一体化方案。内容涵盖硬件连接、CubeMX工程配置、传感器驱动移植、数据滤波算法、OLED显示驱动以及高效的多级菜单系统设计,旨在提供一个稳定、实用且易于移植的嵌入式健康监测项目参考。 阅读详情

相关推荐

自制《大侠狂想曲》修改器:内存修改、加速与一键安装全攻略

游戏修改器是玩家优化游戏体验的常用工具,其核心原理是通过内存修改技术,在游戏进程运行时动态改写数值。常见实现路径是借助Cheat Engine扫描并追踪数据地址,再通过编程语言调用系统API完成读写。这种技术能有效解决重复刷资源带来的枯燥感,特别适用于单机RPG中想快速体验多剧情线却不想重刷资源的情形。本文以《大侠狂想曲》为例,完整拆解了从CE定位金钱与好感度内存地址,到编写C#脚本实现游戏加速、一键增加铜钱与NPC好感度,再到用Inno Setup打包生成一键安装器的全过程,并总结了数值弹回、剧情不触发、

weixin_30368981的博客 1465

HDU 1048 The Hardest Problem Ever

Problem Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself ali

可可 の 猫 895

OpenBCI脑电数据处理实战:用MNE库从Raw对象到可视化分析全流程

本文提供了使用MNE-Python库处理OpenBCI脑电数据的完整实战指南。从通过BrainFlow库获取原始数据流、创建核心的Raw对象,到进行工频滤波、带通滤波等关键预处理步骤,最后实现时域信号、功率谱密度及地形图等多种专业可视化分析,手把手教你完成脑机接口数据处理的全流程。

gin88的博客 369

poj 1298(The Hardest Problem Ever)

很简单的一道字符串处理的题目,就不多加描述了、、、、、、、、、、、、 The Hardest Problem Ever Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 16

ll365594480的专栏 651

Matlab+Matpower实战:手把手教你生成IEEE14节点FDIA攻击数据集(附完整代码)

本文提供了一份基于Matlab与Matpower工具构建IEEE14节点FDIA攻击数据集的完整实战指南。通过动态负荷数据模拟、潮流计算、状态估计及隐蔽攻击向量注入,手把手教你生成可用于电力系统网络安全研究的仿真数据集,并附有核心代码与调试技巧。

bean的博客 398

ovs实现lb负载均衡

负载均衡器的实现原理是通过硬件或软件设备将客户端访问流量根据转发策略分发到多个服务器或设备上,以确保系统的负载均衡。二层负载均衡‌:使用虚拟MAC地址方式,根据OSI模型的二层进行负载均衡。‌四层负载均衡‌:基于IP+端口的负载均衡,主要分析IP层及TCP/UDP层,实现四层负载均衡。‌七层负载均衡‌:从应用层开始,根据虚拟的URL或IP、主机名接收请求,再转向相应的处理服务器。

bobi的博客 953

POJ 1298

#include<iostream>// chengdacaizi 注释!2008 11 05 #include<string> using namespace std; int main() { while(true) { string start;//用于控制循环 cin>>start...

weixin_30352645的博客 139

BMS应用软件开发 — 7 从特斯拉到问界:主流BMS硬件架构深度解析

本文深度解析了从特斯拉Model 3到问界M5的主流BMS硬件架构,探讨了BMS在电动汽车中的核心价值与应用软件开发的关键技术。通过对比分析两家厂商的硬件设计哲学、芯片选型策略及成本控制方法,揭示了BMS硬件系统如何影响电池性能与整车安全。文章特别分享了电压采样精度、EMC设计等实战经验,为BMS开发提供宝贵参考。

weixin_42554408的博客 457

A - The Hardest Problem Ever(字符串模拟题)

Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of the fir

ACM_hades的梦想之路 1088

如何在 Ubuntu 24.04 或 22.04 上安装和使用 GDebi

本文介绍了在Ubuntu 24.04上安装和使用GDebi的方法。GDebi是DPKG的轻量级替代品,能够自动解析并安装.deb包的依赖项。文章详细说明了系统更新、安装GDebi的步骤,并演示了通过GUI和CLI两种方式安装.deb包的操作流程。此外,还提供了验证安装和卸载包的方法。GDebi虽然非必需,但为用户提供了处理依赖项的另一种选择,适合需要安装本地Debian包的用户。

山岚的运维笔记 1989

这20个网络工程项目经验,帮我跳槽加薪不止一次

嘿,大家好,我是圈圈,一个在网络工程圈子里混了十多年的老鸟。从国企的网管起步,到现在给大厂做顾问,我见过太多简历:有的光鲜亮丽,证书一堆,但一聊项目,就露怯;有的简历朴实,但列出的项目经验让人眼前一亮,直接拿offer。为什么?因为招聘官最看重实战。理论谁都会背,项目经验才是你的“硬通货”。尤其在网络工程这行,项目不光证明你的技能,还展示你解决问题的能力。今天,我就分享20个我亲身经历或见过的网络工程项目经验。每个都值得写进简历,不是吹牛,这些项目帮我跳槽加薪不止一次。

网络技术联盟站 432

POJ 1298 The Hardest Problem Ever(我的水题之路——解密,水题)

The Hardest Problem Ever Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 17457   Accepted: 9635 Description Julius Caesar lived in a time of danger and int

591

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

The Hardest Problem Ever - POJ 1298 水题

The Hardest Problem Ever Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 22244   Accepted: 12202 Description Julius Caesar lived in a time of danger and in

提比的强行AC 656

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

pscad IEEE标准系统搭建说明

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

HDU1048 POJ1298 ZOJ1392 UVALive2540 The Hardest Problem Ever【密码+水题】

The Hardest Problem Ever Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 26502   Accepted: 14358 Description Julius Caesar lived in a time of danger and intr

海岛Blog 2886

lwip-2.0.3

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

POJ 1298-The Hardest Problem Ever(Caesar 密码)

POJ 1298-The Hardest Problem Ever(Caesar 密码) 题目链接: The Hardest Problem Ever 思路: 题目大意: 对消息原文中的每个字母,分别用该字母之后的第5个字母替换(例如:消息原文中的每个字母A都分别替换成字母F),其他字符不 变,并且消息原文的所有字母都是大写的 给定翻译后的消息,求原始信息 题解: ...

[SZU_Crayon] 607

1298 The Hardest Problem Ever

题目链接:http://poj.org/problem?id=1298 思路分析:水题,字符偏移求解,注意字符串输入问题即可。 代码如下: #include <iostream> #include <string> using namespace std; const int MAX_N = 200 + 10; char A[MAX_N...

aqjh9999的博客 138

POJ 1298 The Hardest Problem Ever

...直接找下对应关系..#include #include using namespace std; int main(){ char line[105]; while(gets(line)){ if(strcmp(line,"START")==0||strcmp(

飞熊入梦 566

poj 1298- The Hardest Problem Ever

<br />  水题,不解释。<br />  // The Hardest Problem Ever.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> #include<fstream> #include<string> #include<vector> using namespace std; int _tmain(int argc, _T

lhcxx1987的专栏 511

poj 1298 The Hardest Problem Ever

题目来源:http://poj.org/problem?id=1298 #include #include #include #include #include #include using namespace std; int main() { string str; int i; while( cin>>str ) { cin

Abner 830

pku_1298_The Hardest Problem Ever

pku_1298_The Hardest Problem Ever DescriptionJulius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive,

368

POJ1298 The Hardest Problem Ever

题目链接:http://poj.org/problem?id=1298 解题思路: 水题,直接上代码。 AC代码: #include #include #include #include using namespace std; int main() { string a,b,c; while(getline(cin,a)) { if

piaocoder 404
上一篇: Poj1012_Joseph
下一篇: Poj1218_THE DRUNK JAILER(水题)
TaiSung
博客等级 码龄15年 49粉丝 132原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值