PAT 甲级1027. Colors in Mars (20)
2017-06-04 23:43
417 查看
有一个点没过去
#include "bits/stdc++.h"
using namespace std;
string work="0123456789ABC";
string toString13(int num)
{
string s;
while(num)
{
s=work[num%13]+s;
num/=13;
}
return s;
}
int main() {
int n=3;
while(n--)
{
int num;
cin>>num;
if(n==2) cout<<"#";
string s=toString13(num);
if(s.size()==1)
cout<<0;
cout<<s;
}
return 0;
}
#include "bits/stdc++.h"
using namespace std;
string work="0123456789ABC";
string toString13(int num)
{
string s;
while(num)
{
s=work[num%13]+s;
num/=13;
}
return s;
}
int main() {
int n=3;
while(n--)
{
int num;
cin>>num;
if(n==2) cout<<"#";
string s=toString13(num);
if(s.size()==1)
cout<<0;
cout<<s;
}
return 0;
}
相关文章推荐
- PAT(甲级)1027. Colors in Mars (20)
- PAT 甲级 1027. Colors in Mars (20)
- PAT甲级 1027. Colors in Mars (20)
- 【PAT甲级】1027. Colors in Mars (20)
- 【PAT甲级】1027.Colors in Mars (20)
- PAT甲级真题及训练集(13)--1027. Colors in Mars (20)
- 1027. Colors in Mars (20) PAT 甲级
- 浙江大学PAT_甲级_1027. Colors in Mars (20)
- PAT 1027. Colors in Mars (20)
- 【PAT】1027. Colors in Mars (20)
- 浙大 PAT Advanced level 1027. Colors in Mars (20)
- PAT (Advanced Level) Practise 1027 Colors in Mars (20)
- PAT-1027 Colors in Mars (20)
- 【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 1027. Colors in Mars (20)
- PAT 甲级 1027 Colors in Mars
- 【PAT】【Advanced Level】1027. Colors in Mars (20)