PAT (Advanced Level) 1027. Colors in Mars (20)

时间:2023-02-10 09:16:17

简单题。

#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)的更多相关文章

  1. PTA &lpar;Advanced Level&rpar; 1027 Colors in Mars

    Colors in Mars People in Mars represent the colors in their computers in a similar way as the Earth ...

  2. 【PAT甲级】1027 Colors in Mars &lpar;20 分&rpar;

    题意: 输入三个范围为0~168的整数,将它们从十三进制转化为十进制然后前缀#输出. AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC #include& ...

  3. PAT &lpar;Advanced Level&rpar; Practice 1027 Colors in Mars &lpar;20 分&rpar; 凌宸1642

    PAT (Advanced Level) Practice 1027 Colors in Mars (20 分) 凌宸1642 题目描述: People in Mars represent the c ...

  4. PAT 甲级 1027 Colors in Mars &lpar;20 分&rpar;(简单,进制转换)

    1027 Colors in Mars (20 分)   People in Mars represent the colors in their computers in a similar way ...

  5. PAT &lpar;Advanced Level&rpar; Practice 1041 Be Unique &lpar;20 分&rpar; 凌宸1642

    PAT (Advanced Level) Practice 1041 Be Unique (20 分) 凌宸1642 题目描述: Being unique is so important to peo ...

  6. PAT &lpar;Advanced Level&rpar; Practice 1046 Shortest Distance &lpar;20 分&rpar; 凌宸1642

    PAT (Advanced Level) Practice 1046 Shortest Distance (20 分) 凌宸1642 题目描述: The task is really simple: ...

  7. PAT &lpar;Advanced Level&rpar; Practice 1042 Shuffling Machine &lpar;20 分&rpar; 凌宸1642

    PAT (Advanced Level) Practice 1042 Shuffling Machine (20 分) 凌宸1642 题目描述: Shuffling is a procedure us ...

  8. PAT &lpar;Advanced Level&rpar; Practice 1015 Reversible Primes &lpar;20 分&rpar; 凌宸1642

    PAT (Advanced Level) Practice 1015 Reversible Primes (20 分) 凌宸1642 题目描述: A reversible prime in any n ...

  9. PAT &lpar;Advanced Level&rpar; Practice 1027 Colors in Mars &lpar;20 分&rpar;

    People in Mars represent the colors in their computers in a similar way as the Earth people. That is ...

随机推荐

  1. C&plus;&plus;小项目:directx11图形程序(三):graphicsclass

    这是框架的第三层graphicsclass,这个类才真正可以说是整个程序的框架,因为它组织了后面所有的成员. 代码: graphicsclass.h #pragma once #include< ...

  2. Hibernate的游离态与持久态转换

    在Hibernate中,一个PO可能经过长时间的操作,session已过时关闭,此时PO已经是一个游离态的对象,这时要转换为持久战态,有下面几种方法: 1.session.saveOrUpdate(o ...

  3. 微博输入相关js 代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. codevs 2495 水叮当的舞步IDA&ast;

    /* 比较简单的A* 估价函数很简单就是除了左上角的联通快之外的不同的个数 加上迭代 好像答案最多在16步之内出解 这样裸裸的交上去是50分 在考虑剪枝 每个选颜色的时候一定是选左上角联通快附近的颜色 ...

  5. QTabWidget添加自定义样式

    一.参考文章:http://bbs.csdn.net/topics/390632657?page=1 setStyleSheet("QTabWidget::pane{border-width ...

  6. mysql版sql助记

    新建用户 CREATE USER 'username'@'host' IDENTIFIED BY 'password'; [host 中 使用 % 为通配符, 匹配任意远程主机] 赋权 GRANT p ...

  7. asp&period;net core mvc剖析:处理管道构建

    在启动流程文章中提到,在WebHost类中,通过BuildApplication完成http请求处理管道的构建.在来看一下代码: ...... //这个调用的就是Startup.cs类中的Config ...

  8. 使用openssl模拟CA和CA证书的签发

    使用openssl模拟CA和CA证书的签发     当使用ssl/tls进行加密通信时,必须要有数字证书.若通信只限制在局域网内,可以不向第三方机构申请签发证书,可以通过openssl模拟CA(Cer ...

  9. XML和Schema

    2017-11-03 19:33:56 XML:Extensible Markup Language,也就是可扩展标记语言.XML工具使处理和转化信息变得十分容易和方便. XML和HTML格式是古老的 ...

  10. DirectoryEntry 账户启动与停用 以及创建账户等

    启动账户: DirectoryEntry usr = new DirectoryEntry("LDAP://CN=New User,CN=users,DC=fabrikam,DC=com&q ...