随笔分类 - 基础算法 / 进制转换
摘要:十进制数m有01234567共8位 取123位置的二进制数方法 (m >> 4) & 0x07 取4567位置的二进制数方法 m & 0x0f 例题 响应报文时间 样例1 输入 3 0 20 1 10 8 20 输出 11 样例2 输入 2 0 255 200 60 输出 260 样例3 输入 1
阅读全文
摘要:计算B进制的值(秦九韶算法) 4945. 比大小 #include <iostream> #include <cstring> using namespace std; typedef long long LL; LL get() { LL res = 0; int n, b; cin >> n >
阅读全文
摘要:M进制转N进制 3374. 进制转换2 #include <iostream> #include <algorithm> #include <cstring> #include <vector> using namespace std; int main() { int a, b; string s
阅读全文
摘要:1346. 回文平方 进位制、双指针判断回文数 #include <iostream> #include <algorithm> #include <cstring> using namespace std; char get(int x) // 将x转化为b进制 { if(x <= 9) retu
阅读全文