PAT 1027. Colors in Mars
来源:互联网 发布:手机淘宝的扫一扫在哪 编辑:程序博客网 时间:2024/05/16 11:52
题意: 给出 红 绿 蓝 三个颜色的值,把这3个值分别转成13进制并一起输出
注意点:很简单的转换。注意 168 0 1的转换为 CC0001即可。
//628K94MS#include<cstdio>#include<algorithm>#include<cstring>#include<iostream>#include<stack>#include<vector>#include<queue>using namespace std;#define inf 0x3f3f3f3f#define M 2500int main(){int num[3],c;char low,high;scanf("%d%d%d",&num[0],&num[1],&num[2]);cout<<"#";for(int i=0;i<3;i++){c = num[i];low = c % 13;c = c / 13;high = c % 13;if( low >= 10)low = 'A' + low - 10;else low = '0' + low;if( high >= 10)high = 'A' + high - 10;else high = '0' + high;cout<<high<<low;}cout<<endl;}
阅读全文
0 0
- PAT--1027. Colors in Mars
- 【PAT】1027. Colors in Mars
- PAT 1027. Colors in Mars
- 1027. Colors in Mars (20)-PAT
- 【PAT】1027. Colors in Mars (20)
- PAT 1027. Colors in Mars (20)
- PAT A 1027. Colors in Mars (20)
- PAT 1027. Colors in Mars (20)
- PAT 1027. Colors in Mars (20)
- PAT A 1027. Colors in Mars
- pat 1027. Colors in Mars (20)
- PAT 1027. Colors in Mars (20)
- PAT 1027. Colors in Mars (20)
- PAT(A) - 1027. Colors in Mars (20)
- PAT-A 1027. Colors in Mars
- PAT甲级.1027. Colors in Mars (20)
- 【PAT甲级】1027. Colors in Mars (20)
- 1027. Colors in Mars (20) PAT 甲级
- 什么是数据库连接池?
- 数学等于号是=那三个横杠是什么符
- 免费的论文查重网站
- (转)WorldQuant :如何缔造量化金融王国
- j2ee规范-jndi-在Tomcat中配置数据源
- PAT 1027. Colors in Mars
- NYOJ 56 阶乘因式分解(一)
- USACO Section 1.2 Palindromic Squares
- 虚函数与纯虚函数的区别
- JavaScript DOM 如何区分元素节点、属性节点和文本节点?
- 【解题报告】HDU-4614 Vases and Flowers 线段树+二分
- UDT接收发送广播
- React Native学习笔记(0)--index.ios.js的结构
- Android APK反编译就这么简单 详解(图文详解)