您的位置:首页 > 其它

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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: