浙江大学PAT_甲级_1027. Colors in Mars (20)

数字IC后端笔记-libcell命名规则与标准单元库介绍 ND3D1BWP13T40P140HVTND3D1BWP13T40P140HVTTSMC两种工艺,Metalization Stack的截面示意图:还有一层AP用来走RDL,RDL这层是最厚的一层,一般用于连接IO的bump,信号线基本上不会用这层绕线。 阅读详情

题目链接:点击打开链接

People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and the last 2 digits for Blue. The only difference is that they use radix 13 (0-9 and A-C) instead of 16. Now given a color in three decimal numbers (each between 0 and 168), you are supposed to output their Mars RGB values.

Input

Each input file contains one test case which occupies a line containing the three decimal color values.

Output

For each test case you should output the Mars RGB value in the following format: first output "#", then followed by a 6-digit number where all the English characters must be upper-cased. If a single color is only 1-digit long, you must print a "0" to the left.

Sample Input
15 43 71
Sample Output
#123456

The only difference is that they use radix 13 (0-9 and A-C) instead of 16. 

唯一的区别是,他们使用的,而不是16基数13(0-9和AC)。

输入的数字要转换为13进制。

C++程序:

#include<iostream>
#include<string>
using namespace std;
void transform(int num)
{
	char c[3] = { 'A','B','C' };
	if (num / 13 >= 10)// num / 13商数
	{
		cout << c[num / 13 - 10];
	}
	else
	{
		cout << num / 13;
	}
	if (num % 13 >= 10)// num % 13 余数
	{
		cout << c[num % 13 - 10];
	}
	else
	{
		cout << num % 13;
	}
}
int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	cout << '#';
	transform(a);
	transform(b);
	transform(c);
	//system("pause");
	return 0;
}


手把手教你学Simulink——基于Simulink的无感FOC(滑模观测器+PLL)实战 摘要: 本文详细介绍了基于Simulink的无感FOC(滑模观测器+PLL)实现方法。主要内容包括:1)SMO+PLL原理,通过滑模观测器估算反电动势,结合PLL抑制抖振;2)系统架构,替代编码器信号;3)Simulink建模流程,涵盖Clarke变换、SMO离散化实现、PLL设计等关键步骤;4)参数整定指南和工程实践要点,如启动策略和故障处理。该方法具有成本低、可靠性高的优势,适用于家电、电动车等场景,仿真结果显示角度误差±5°,速度动态跟随良好。文章还提供了调试建议和常见问题解决方案。 阅读详情

相关推荐

Android 集成Chrome 浏览器内核 Crosswalk

Crosswalk 内核的兴起与消亡 Android 4.4 版本之前,使用的是基于 androidWebKit 的 WebView 但实际上,由于 Android 的碎片化问题(大量存在不同的 Android 系统版本,并且各个厂商对内置应用进行定制化,有可能用的不是最新的浏览器内核)。这就导致 WebView 在真实环境中对 API 的支持根本无迹可寻,越发混乱。 随着混合开发的兴起,前端对 ...

司马懿的西山居 2万+

【PAT(甲级)】1027 Colors in Mars(易错点分析)

【PAT(甲级)】1027 Colors in Mars(易错点分析) 测试点分析

weixin_55202895的博客 266

相机标定-机器视觉基础(理论推导、Halcon和OpenCV相机标定)

相机标定是获得目标工件精准坐标信息的基础。首先,必须进行相机内参标定,构建一个模型消除图像畸变;其次,需要对相机和机器人的映射关系进行手眼标定,构建一个模型将图像坐标系上的点映射到世界坐标系。主要分为背景知识、相机内外参模型推导、编程代码实现三个部分。

beyond951的博客 7314

【PAT(甲级)】1030 Travel Plan

【PAT(甲级)】1030 Travel Plan(Dijkstra+dfs)

weixin_55202895的博客 397

Android 集成 Google 与 Facebook 第三方登录实战详解(2024版)

本文详细介绍了2024年Android应用集成Google与Facebook第三方登录的完整实战指南。通过分步教程和代码示例,帮助开发者快速实现一键登录功能,提升用户体验和注册转化率,同时涵盖隐私合规和常见错误处理的最佳实践。

blue的专栏 832

英飞凌Tricore实战系列导读

笔者结合项目应用经验对Tricore MCU的开发及应用经验进一步总结,成人达己,渡己渡人。

initiallizer的博客 3805

【PAT甲级】1030 Travel Plan (30分):最短路径Dijkstra/Dijkstra+DFS

1030 Travel Plan (30分) A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler t...

u012161251的博客 541

Cadence OrCAD Capture 保持元器件编号情况复制元件,复制后元器件编号与复制前不同的问题解决

如下图所示复制时,已经勾选了“Preserve reference on copy”但是复制后的编号却与复制前不一样。本文简单介绍其原因及解决方法。

fydar的博客 3179

1030. Travel Plan (30)

A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path b...

291

数美device_fingerprint、device_id、hmac生成

device_fingerprint、hmac、device_id参数分析与解读

吴秋霖的博客 2915

使用Simulink设计并实现一个可调谐的二阶IIR陷波滤波器,实时去除音频中的工频噪声

《基于Simulink的音频陷波滤波器设计与实现》摘要:本文详细介绍了使用Simulink设计陷波滤波器去除音频工频噪声(如50Hz)的方法。核心内容包括:1)二阶IIR陷波滤波器的原理与传递函数;2)Simulink实现步骤(音频系统搭建、滤波器设计、频率跟踪);3)性能分析(频谱对比、时域波形、听觉测试)。通过精准消除特定频率干扰,同时保留语音信号(200Hz-4kHz),有效提升信噪比(>20dB)。文章还探讨了多陷波级联、自适应算法等高级技巧,为音频处理、语音通信等应用提供实用解决方案。

amy_mhd的博客 168

Dijkstra算法 pat1030 Travel Plan

Description A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to decide the shortest path between his/her starting city and the destin

Jankin'way 232

第29章:PCL PrincipalCurvatures 曲率估计

PrincipalCurvatures(主曲率估计)是一种用于计算点云表面曲率的算法。曲率描述了曲面局部的弯曲程度,是表面几何特征的重要指标。在点云处理中,估计表面的曲率对于形状分析、物体识别、表面重建等任务非常重要。主曲率是曲面上某一点的最大和最小曲率方向。通过计算点云的主曲率,我们可以获得点云中每个点的局部形状特征。通常情况下,主曲率包括两个主要参数:最大主曲率(最大曲率方向上的曲率)和最小主曲率(最小曲率方向上的曲率)。优点缺点提供了对点云表面局部形状的深入分析。

yumeiguo的博客 217

【PAT甲级A1027】 Colors in Mars (20分)(c++)

1027 Colors in Mars (20分) 作者:CHEN, Yue 单位:浙江大学 代码长度限制:16 KB 时间限制:400 ms 内存限制:64 MB People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits ar

小庄同学的博客 154

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

PAT甲级 1027 Colors in Mars

10进制转13进制的,要注意补齐两位0 GitHub - ZouJiu1/PAT: 浙江大学PAT题目解答内容浙江大学PAT题目解答内容. Contribute to ZouJiu1/PAT development by creating an account on GitHub.https://github.com/ZouJiu1/PAT

邹九的个人博客 191

WINCC7.3破解文件

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

PAT_1027: Colors in Mars

People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 dig

badmartin的技术世界 998

lwip-2.0.3

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

1027. Colors in Mars (20)【进制转换】——PAT (Advanced Level) Practise

题目信息1027. Colors in Mars (20)时间限制400 ms 内存限制65536 kB 代码长度限制16000 BPeople in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-d

1302

Colors in Mars

People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 dig

sheng_xc的专栏 457

1027. Colors in Mars (20)

考察查询表以及求余分位 #include #include char g_CharTable[13] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C'}; void OutPutIntVector(const std::vector& a) { int size = (int)a.size(); for(

孙佰贵的专栏 1992

PATA 1027 Colors in Mars

思路分析: 用一个字符串数组str存储0-9,A-C,str[i]对应i的字符串形式,将int型转换为char型 #include&quot;stdafx.h&quot; #include&amp;lt;stdlib.h&amp;gt; void func(int a) { char str[15] = &quot;0123456789ABC&quot;, ans[5]; int x, y; x = a / 13; ...

qq_38677031的博客 342

PAT 甲级 1027 Colors in Mars(20 分)

1027 Colors in Mars(20 分) People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits ar...

宝付支的博客 439

浙大PAT 1027题 1027. Colors in Mars

水题,代码写的有点戳 #include int main(){ int r,g,b,cnt; char rst[6]={'0','0','0','0','0','0'}; scanf("%d %d %d",&r,&g,&b); cnt=0; while(r>=13){ if(r>9) rst[cnt]=r-10+'A'; else rst[cnt]=r+'0';

Sup_Heaven的专栏 1251

pat 1027. Colors in Mars (20)

1027. Colors in Mars (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue People in Mars represent the colors in thei

Yesterday You Said Tomorrow. 726

pat 甲级 1027-1030

1027. Colors in Mars (20)People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are

chengxiaona的博客 367

pat 甲级 1027

1027 Colors in Mars (20 分) People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits a...

lzy我就来随便逛逛的博客 284

1027 Colors in Mars (20)

#include #include #include using namespace std; class CA { public: void run(); char earthtomars(int a); private: int a[3]; char b[7]; }; void CA::run() { cin>>a[0]>>a[1]>>a[2];

rightwi的专栏 587
上一篇: 浙江大学PAT_甲级_1024. Palindromic Number (25)
下一篇: 浙江大学PAT_甲级_1031. Hello World for U (20)
pythontojava
博客等级 码龄12年 84粉丝 140原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址