网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  PAT (Advanced Level) 1027. Colors in Mars (20)

PAT (Advanced Level) 1027. Colors in Mars (20)

分类: IT文章 • 2025-01-15 08:14:01

简单题。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

void pri(int a)
{
    if (a <= 9) printf("%d", a);
    else printf("%c", a-10+'A');
}

void print(int a){
    if (a >= 13) { pri(a/13);  pri(a%13);}
    else { printf("0"); pri(a); }
}
int main()
{
    int r, g, b;
    scanf("%d%d%d", &r, &g, &b);
    printf("#");
    print(r); print(g); print(b);
    printf("
");
    return 0;
}

相关推荐

  • PAT (Advanced Level) 1019. General Palindromic Number (20)
  • PAT (Advanced Level) 1027. Colors in Mars (20)
  • PAT (Advanced Level) 1023. Have Fun with Numbers (20)
  • PAT (Advanced Level) 1031. Hello World for U (20)
  • PAT Advanced 1100 Mars Numbers (20分)
  • PAT (Advanced Level) Practice 1116 Come on! Let's C (20分) 1.题目 2.代码
  • PAT (Advanced Level) Practice 1112 Stucked Keyboard (20分) (基础不扎实的后果) 1.题目 2.题目分析  3.代码
  • PAT (Advanced Level) Practice 1019 General Palindromic Number (20 分) (进制转换,回文数)
  • PAT (Advanced Level) Practice 1152 Google Recruitment (20 分)
  • PAT (Advanced Level) Practice 1120 Friend Numbers (20 分) (set)
  • 活动可视化搭建系统——你的KPI被我承包了
  • luogu P2828 Switching on the Lights(开关灯)
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号