本文同步发布在CSDN:https://blog.csdn.net/weixin_44385565/article/details/90678474 1100 Mars Numbers (20 分)   People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earth is called "jan, feb,…
#include<stdio.h> #include<stdlib.h> #include<string.h> char *join1(char *, char*); void join2(char *, char *); char *join3(char *, char*); int main(void) { char a[4] = "abc"; // char *a = "abc" char b[4] = "def&…
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number. Now for any pair of positive integers N​1​​ and N​2​​, your task is to find the radi…
People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earth is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, respectively. For the next higher dig…
前情提要: int 的相关操作 进制转换 bit_lenth() str 的索引,以及常用的相关方法 for 循环 索引 切片 相关方法 一  : int 的相关操作 int 主要用于生活中的计算问题, >>>1 :进制转换问题 十进制  转  二进制 42 转换成 2进制 对2 取余数,然后逆向排列 42 / 2   = 0 21 / 2=    1 10 / 2 =   0 5 / 2  =  1 2 / 2 =    0         =   1    0    0     1 …
1100 Mars Numbers People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, respectively. For t…
1100 Mars Numbers (20 分) People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, respectively…
1100 Mars Numbers(20 分) People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, respectively.…
进制转换题 PAT (Advanced Level) Practice 进制转换题 目录 <算法笔记> 重点摘要 1015 Reversible Primes (20) 1019 General Palindromic Number (20) 1027 Colors in Mars (20) 1058 A+B in Hogwarts (20) 1100 Mars Numbers (20) <算法笔记> 3.5 进制转换 重点摘要 P进制转换为Q进制,分两步 P进制转换为10进制 /…
题意:进制转换. 思路:注意当数字是13的倍数时,只需高位叫法的单词.比如26,是“hel”,而不是“hel tret”.我被坑在这里了!对应语句1的处理.另外,在输入n和n个字符串之间需要一个吸收字符的函数,这个也搞了半天! 数字转字符串时:需要考虑(1)0~12:(2)13,26等13的倍数:(3)29,115等常规情况. 字符串转数字时:需要考虑(1)tret:(2)xxx xxx:(3)xxx,其中这一类又分为低位和高位两种可能,低位的话可直接输出,高位的话要乘base(即13). 代码…