当前位置:网站首页>[C language] General method of base conversion
[C language] General method of base conversion
2022-07-31 03:38:00 【rookieﻬ°】
Let's not talk nonsense, just go to the code:
//Here we set a decimal number and convert it to a hexadecimal number (and so on)int main(){int n = 0;scanf("%d", &n);span>int change_num = 0;//Set change_num as the final resultint ret = 1;//The number that must be set for hex conversionwhile (n){change_num += ret * (n % 6);span>//Key point!!n /= 6;ret *= 10;}printf("%d\n", change_num);return 0;}Simple and concise, if you like it, remember to leave a like~~
边栏推荐
- 数据库实现分布式锁
- (树) 最近公共祖先(LCA)
- Getting Started with CefSharp - winform
- "DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction" paper notes
- 自己的一些思考
- 大小端模式
- 安全20220709
- SQL Interview Questions (Key Points)
- 【动态规划】连续子数组的最大和
- The els block moves the boundary to the right, and accelerates downward.
猜你喜欢

《DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction》论文笔记

LocalDate addition and subtraction operations and comparison size
![[Compilation principle] Design principle and implementation of recursive descent parsing](/img/51/cd054a8246dc108520d6ff9ea26c60.png)
[Compilation principle] Design principle and implementation of recursive descent parsing

Ambiguous method call.both

大小端模式

C语言从入门到如土——数据的存储

(八)Math 类、Arrays 类、System类、Biglnteger 和 BigDecimal 类、日期类

5. How does the SAP ABAP OData service support the $filter operation

Know the showTimePicker method of the basic components of Flutter

$attrs/$listeners
随机推荐
SIP Protocol Standard and Implementation Mechanism
$attrs/$listeners
LeetCode simple problem to find the subsequence of length K with the largest sum
立足本土,链接全球 | 施耐德电气“工业SI同盟”携手伙伴共赴未来工业
Detailed explanation of TCP (2)
BUG definition of SonarQube
自己的一些思考
数据库文件中的未分配的块和未使用的块的区别
安全20220709
The Map Entry understanding and application
Based on the local, linking the world | Schneider Electric "Industrial SI Alliance" joins hands with partners to go to the future industry
组件传值 provide/inject
Redis实现分布式锁
No qualifying bean of type 问题
Distributed locks and three implementation methods
Addition and Subtraction of Scores in LeetCode Medium Questions
[C language] General method for finding the sum of the greatest common factor and the least common multiple of two integers m and n, the classical solution
(六)枚举、注解
(八)Math 类、Arrays 类、System类、Biglnteger 和 BigDecimal 类、日期类
(线段树) 基础线段树常见问题总结