当前位置:网站首页>PAT甲级 1027 Colors in Mars
PAT甲级 1027 Colors in Mars
2022-07-03 07:34:00 【九是否非随机的称呼】
10进制转13进制的,要注意补齐两位0
#include<iostream>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
string convert13(int k){
string s;
int m, n, i;
m = k;
if(m==0) s = "00";
while(m!=0){
m = k/13;
n = k%13;
if(n==10) s += "A";
else if(n==11) s += "B";
else if(n==12) s += "C";
else s += to_string(n);
k = m;
}
reverse(s.begin(), s.end());
if(s.length()==1) return "0" + s;
return s;
}
int main(int argc, char **argv){
int a, c, w, i, j;
cin>>a>>c>>w;
cout<<"#"<<convert13(a)<<convert13(c)<<convert13(w);
return EXIT_SUCCESS;
}
边栏推荐
- Le Seigneur des anneaux: l'anneau du pouvoir
- 【MySQL 14】使用DBeaver工具远程备份及恢复MySQL数据库(Linux 环境)
- c语言指针的概念
- Why is data service the direction of the next generation data center?
- 【CoppeliaSim4.3】C#调用 remoteApi控制场景中UR5
- Longest common prefix and
- Lucene merge document order
- Es writing fragment process
- Some experiences of Arduino soft serial port communication
- 【MindSpore论文精讲】AAAI长尾问题中训练技巧的总结
猜你喜欢
最全SQL与NoSQL优缺点对比
Homology policy / cross domain and cross domain solutions /web security attacks CSRF and XSS
【MySQL 11】怎么解决MySQL 8.0.18 大小写敏感问题
Technical dry goods | reproduce iccv2021 best paper swing transformer with Shengsi mindspire
截图工具Snipaste
Comparison of advantages and disadvantages between most complete SQL and NoSQL
Paper learning -- Study on the similarity of water level time series of Xingzi station in Poyang Lake
《指环王:力量之戒》新剧照 力量之戒铸造者亮相
Analysis of the problems of the 7th Blue Bridge Cup single chip microcomputer provincial competition
Lucene introduces NFA
随机推荐
Collector in ES (percentile / base)
Industrial resilience
Introduction of transformation flow
c语言指针的概念
Robots protocol
Jeecg request URL signature
PgSQL converts string to double type (to_number())
Common analysis with criteria method
最全SQL与NoSQL优缺点对比
[mindspire paper presentation] summary of training skills in AAAI long tail problem
项目经验分享:基于昇思MindSpore实现手写汉字识别
【开发笔记】基于机智云4G转接板GC211的设备上云APP控制
Dora (discover offer request recognition) process of obtaining IP address
Common operations of JSP
IndexSort
图像识别与检测--笔记
Industrial resilience
Es writing fragment process
Some basic operations of reflection
【MySQL 14】使用DBeaver工具远程备份及恢复MySQL数据库(Linux 环境)