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

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

Output Specification:

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 its left.

Sample Input:

  1. 15 43 71

Sample Output:

  1. #123456
  2.  
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. char num[] = {'','','','','','','','','','','A','B','C'};
  6.  
  7. void deal(int oct)
  8. {
  9. cout<<num[oct/]<<num[oct%];
  10. }
  11.  
  12. int main()
  13. {
  14. int R,G,B;
  15.  
  16. cin>>R>>G>>B;
  17.  
  18. cout<<'#';
  19.  
  20. deal(R);
  21. deal(G);
  22. deal(B);
  23.  
  24. return ;
  25. }

PAT 甲级 1027 Colors in Mars (20 分)的更多相关文章

  1. PAT 甲级 1027 Colors in Mars (20 分)(简单,进制转换)

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

  2. PAT Advanced 1027 Colors in Mars (20 分)

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

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

  4. PAT甲级——1027 Colors in Mars

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

  5. 【PAT甲级】1027 Colors in Mars (20 分)

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

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

  7. PAT 甲级 1027 Colors in Mars

    https://pintia.cn/problem-sets/994805342720868352/problems/994805470349344768 People in Mars represe ...

  8. 1027 Colors in Mars (20 分)

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

  9. PAT甲级:1152 Google Recruitment (20分)

    PAT甲级:1152 Google Recruitment (20分) 题干 In July 2004, Google posted on a giant billboard along Highwa ...

随机推荐

  1. js 前端 table 导出 excel

    园子,github,stackoverflow 关于前端下载的文章不少 园子里大部分都是 利用ActiveXObject对象来实现,可他有个缺点安全等级,还有必须安装excel…… github,st ...

  2. kafka consumer 指定 offset,进行消息回溯

    kafka consumer 如何根据 offset,进行消息回溯?下面的文档给出了 demo: https://cwiki.apache.org/confluence/display/KAFKA/0 ...

  3. ceph Luminous版手动安装零散记录

    1.安装必要的依赖包,关防火墙,向/etc/hosts内添加域名等 2.安装ceph 配置yum源 (如果嫌慢,可以配置cachedir=/home/yum/$basearch/$releasever ...

  4. SpringMVC 搭建遇到的坑

    1. Caused by: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 60; cvc-complex-type.2.4.c ...

  5. 禁止WORDPRESS站内搜索的方法

    如果我们希望禁止站内搜索,毕竟会是的MYSQL负担加重,我们可以禁止掉,然后在使用第三方搜索组件.比如用百度站内搜索或者360站内搜索. function fb_filter_query( $quer ...

  6. bootstrap--------bootstrap table

    bootstrap table 显示行号 <th rowspan="2" data-field="index" data-formatter=" ...

  7. java集合之List。

    实际上有两种List:一种是基本的ArrayList其优点在于随机访问元素,另一种是更强大的LinkedList它并不是为快速随机访问设计的,而是具有一套更通用的方法. List:次序是List最重要 ...

  8. SVN创建分支/合并分支/切换分支

    在建立项目版本库时,可首先建好项目文件夹,并在其中建立trunk, branches, tags三个空的子目录.这样在trunk中开始进行开发 trunk是主分支,是日常开发进行的地方. branch ...

  9. 01_Mybaits逆向工程maven版

    1.创建generatorSqlmapCustom工程 2.修改pom文件 <?xml version="1.0" encoding="UTF-8"?&g ...

  10. Dilated Convolutions 空洞卷积

    Dilated Convolutions,中文一般称为空洞卷积或者扩张卷积,是一种改进的图像卷积方法. 扩张卷积工作示意图如下: 图a是普通的卷积,感受野是3*3,相当于扩充dilation=0 图b ...