def str_to_hex(s): return r"/x"+r'/x'.join([hex(ord(c)).replace('0x', '') for c in s]) def hex_to_str(s): ) :]]]) def str_to_bin(s): return ' '.join([bin(ord(c)).replace('0b', '') for c in s]) def bin_to_str(s): ) for b in s.split(' ')]]) a=&quo…
进制转化类题目类型: 代码详解及注释解答: //进制转化问题 #include <bits/stdc++.h> using namespace std; int main(){ // 1.反序数 123->321 // int n; // int sn = 0;//存取反序数 // scanf("%d", &n); // while( n!=0 ){ // sn = sn * 10; // sn += (n%10);//求出最后一位,即123的3 // n…