摘要: int reverse(int x){ int ans = 0; while (x){ ans *= 10; ans += x % 10; x /= 10; } return ans; } 阅读全文
posted @ 2023-12-07 21:29 Green_wang 阅读(14) 评论(0) 推荐(0)
摘要: 直接封装函数返回string string dec_bin(long long x){ string s = ""; while(x > 0){ int yu = x % 2; s = char(yu + '0') + s; x /= 2; } return s; } 阅读全文
posted @ 2023-12-07 20:12 Green_wang 阅读(10) 评论(0) 推荐(0)