PAT (Advanced Level) 1027. Colors in Mars (20)
简单题。
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; void pri(int a)
{
if (a <= ) printf("%d", a);
else printf("%c", a-+'A');
} void print(int a){
if (a >= ) { pri(a/); pri(a%);}
else { printf(""); pri(a); }
}
int main()
{
int r, g, b;
scanf("%d%d%d", &r, &g, &b);
printf("#");
print(r); print(g); print(b);
printf("\n");
return ;
}
PAT (Advanced Level) 1027. Colors in Mars (20)的更多相关文章
- PTA (Advanced Level) 1027 Colors in Mars
Colors in Mars People in Mars represent the colors in their computers in a similar way as the Earth ...
- 【PAT甲级】1027 Colors in Mars (20 分)
题意: 输入三个范围为0~168的整数,将它们从十三进制转化为十进制然后前缀#输出. AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC #include& ...
- PAT (Advanced Level) Practice 1027 Colors in Mars (20 分) 凌宸1642
PAT (Advanced Level) Practice 1027 Colors in Mars (20 分) 凌宸1642 题目描述: People in Mars represent the c ...
- PAT 甲级 1027 Colors in Mars (20 分)(简单,进制转换)
1027 Colors in Mars (20 分) People in Mars represent the colors in their computers in a similar way ...
- PAT (Advanced Level) Practice 1041 Be Unique (20 分) 凌宸1642
PAT (Advanced Level) Practice 1041 Be Unique (20 分) 凌宸1642 题目描述: Being unique is so important to peo ...
- PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642
PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642 题目描述: The task is really simple: ...
- PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642
PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642 题目描述: Shuffling is a procedure us ...
- PAT (Advanced Level) Practice 1015 Reversible Primes (20 分) 凌宸1642
PAT (Advanced Level) Practice 1015 Reversible Primes (20 分) 凌宸1642 题目描述: A reversible prime in any n ...
- PAT (Advanced Level) Practice 1027 Colors in Mars (20 分)
People in Mars represent the colors in their computers in a similar way as the Earth people. That is ...
随机推荐
- 一个小知识点强引用__strong 弱引用__weak
__weak的类型的指针是不会影响对象的释放 当系统释放后 会自动的指向nil: __Strong 至少有一个__Strong类型的指针是 对象不会释放
- window.open页面关闭后刷新父页面
如题 function openWin(url,text,winInfo){ var winObj = window.open(url,text,winInfo); var loop = setInt ...
- android之DPAD上下左右四个键控制
我们代码的目的很简单,那就是监听上下左右中这几个键的事件触发.直接上代码: dpad.xml <?xml version="1.0" encoding="utf-8 ...
- flowers
问题大全 Do you like flowers?(Why?) What flowers do you like?(why?) What is your favorite flower? Are fl ...
- QQ 自动接收远程连接之关闭了远程桌面
之前使用都好好的,后来就不知道怎么了突然就不行了,在另外一个远程桌面软件(向日葵)失效后,木有办法,查查查,终于查出来了,是我本机的时间服务停止了,导致我本机的时间和服务器时间不一致,所以连接不上.只 ...
- c++判断一个字符串是否是数字
bool isNum(const string& str) { bool bRet = false; bool point = false; ) { return bRet; } ]) &am ...
- listener、context、filter、servlet及其加载顺序
首先说加载顺序:context-param—>listener —> filter —> servlet 这四类加载顺序与配置顺序无关,对于每一类内部的加载顺序,与配置顺序有关: l ...
- Java学习笔记之多态
1.父类型的引用可以指向子类型的对象: Parent p = new Child(); 2.当使用多态方式调用方法时,首先检查父类中是否有该方法,如果没有,则编译错误:如果有,再去调用子类的该同名方法 ...
- C# 垃圾回收机制(转)
摘要:今天我们漫谈C#中的垃圾回收机制,本文将从垃圾回收机制的原理讲起,希望对大家有所帮助. GC的前世与今生 虽然本文是以.NET作为目标来讲述GC,但是GC的概念并非才诞生不久.早在1958年,由 ...
- as3 组件定义
package kingBook{ import flash.display.MovieClip; import flash.events.Event; import flash.utils.setT ...