题意:

输入三个范围为0~168的整数,将它们从十三进制转化为十进制然后前缀#输出。

AAAAAccepted code:

 #define HAVE_STRUCT_TIMESPEC
#include<bits/stdc++.h>
using namespace std;
char ans[][];
int main(){
int a,b,c;
cin>>a>>b>>c;
int cnt=;
while(a){
int x=a%;
if(x==)
ans[][++cnt]='A';
else if(x==)
ans[][++cnt]='B';
else if(x==)
ans[][++cnt]='C';
else
ans[][++cnt]=x+'';
a/=;
}
if(cnt==)
ans[][]='',ans[][]='';
else if(cnt==)
ans[][]='';
cnt=;
while(b){
int x=b%;
if(x==)
ans[][++cnt]='A';
else if(x==)
ans[][++cnt]='B';
else if(x==)
ans[][++cnt]='C';
else
ans[][++cnt]=x+'';
b/=;
}
if(cnt==)
ans[][]='',ans[][]='';
else if(cnt==)
ans[][]='';
cnt=;
while(c){
int x=c%;
if(x==)
ans[][++cnt]='A';
else if(x==)
ans[][++cnt]='B';
else if(x==)
ans[][++cnt]='C';
else
ans[][++cnt]=x+'';
c/=;
}
if(cnt==)
ans[][]='',ans[][]='';
else if(cnt==)
ans[][]='';
cout<<"#"<<ans[][]<<ans[][]<<ans[][]<<ans[][]<<ans[][]<<ans[][];
return ;
}

最新文章

  1. C#-WebForm-简单控件
  2. &quot;Java 反序列化&quot;过程远程命令执行漏洞
  3. ASP.NET中的KRE是什么?
  4. Redis优化经验
  5. netty 粘包问题处理
  6. 【BZOJ 1007】 [HNOI2008]水平可见直线
  7. FormsAuthentication 登录兼容 IE11 保存cookie
  8. oracle sys sysman system 介绍
  9. 每天学点管理学知识——情绪ABC理论
  10. mac 环境下使用virtual box 虚拟机(win7)与主机之间互相ping通
  11. [C++] 获取IE代理server的账号password
  12. referencedColumnName
  13. SpringMVC入门就这么简单
  14. spring-oauth-server实践:使用授权方式四:client_credentials 模式的客户端和服务端交互
  15. IntelliJ IDEA 2016.2 配置Tomcat 运行Web项目
  16. zigbee 安全通信加密链接密钥
  17. web自动化测试---css方式定位页面元素
  18. SQL alwayson 辅助接点查询统计信息“丢失”导致查询失败
  19. 记录一个elasticsearch 的索引templates
  20. PHP微信支付开发

热门文章

  1. java中Integer面试的坑
  2. i.MX RT1010之FlexIO模拟SSI外设
  3. Github Pull Request的提出与采纳
  4. laravel执行数据库迁移的过程中出现Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] Operation timed out (SQL: select * from information_schema.tables where table_schema = shop and table_name = migrations
  5. 反混淆 de4dot
  6. STM32F030 启用内部晶振并配置系统时钟为48M
  7. CSS选择器效率问题
  8. IIS-反向代理简介
  9. php substr的一些用法
  10. 提高Scrapy爬取效率