当前位置:网站首页>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;
}边栏推荐
- [Development Notes] cloud app control on device based on smart cloud 4G adapter gc211
- C WinForm framework
- 《指環王:力量之戒》新劇照 力量之戒鑄造者亮相
- VMWare网络模式-桥接,Host-Only,NAT网络
- TypeScript let与var的区别
- Analysis of the ninth Blue Bridge Cup single chip microcomputer provincial competition
- 技术干货|昇思MindSpore算子并行+异构并行,使能32卡训练2420亿参数模型
- Understanding of class
- Analysis of the problems of the 10th Blue Bridge Cup single chip microcomputer provincial competition
- HISAT2 - StringTie - DESeq2 pipeline 进行bulk RNA-seq
猜你喜欢

Common methods of file class

Common architectures of IO streams

Circuit, packet and message exchange

Shengsi mindspire is upgraded again, the ultimate innovation of deep scientific computing

Introduction of transformation flow

最全SQL与NoSQL优缺点对比

Analysis of the problems of the 12th Blue Bridge Cup single chip microcomputer provincial competition

The embodiment of generics in inheritance and wildcards

TreeMap

HCIA notes
随机推荐
An overview of IfM Engage
Topic | synchronous asynchronous
Hnsw introduction and some reference articles in lucene9
The concept of C language pointer
Leetcode 213: looting II
Introduction of transformation flow
OSI knowledge sorting
The difference between typescript let and VaR
为什么说数据服务化是下一代数据中台的方向?
TypeScript let与var的区别
IPv4 address
PgSQL converts string to double type (to_number())
Realize the reuse of components with different routing parameters and monitor the changes of routing parameters
技术干货|昇思MindSpore NLP模型迁移之LUKE模型——阅读理解任务
Technical dry goods | alphafold/ rosettafold open source reproduction (2) - alphafold process analysis and training Construction
[Development Notes] cloud app control on device based on smart cloud 4G adapter gc211
技术干货|昇思MindSpore NLP模型迁移之Bert模型—文本匹配任务(二):训练和评估
Wireshark software usage
Lombok cooperates with @slf4j and logback to realize logging
Rabbit MQ message sending of vertx
https://github.com/ZouJiu1/PAT