当前位置:网站首页>[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~~
边栏推荐
- [Swift]自定义点击APP图标弹出的快捷方式
- 3.5 】 【 Cocos Creator slow operating system to stop all animations
- Know the showTimePicker method of the basic components of Flutter
- [C language] Three-pointed chess (classic solution + list diagram)
- Redis 使用 sorted set 做最新评论缓存
- Safety 20220712
- STM32 problem collection
- 慧通编程第4关 - 魔法学院第6课
- 安全20220709
- 端口排查步骤-7680端口分析-Dosvc服务
猜你喜欢
"DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction" paper notes
type_traits元编程库学习
IDEA常用快捷键与插件
Safety 20220712
With 7 years of experience, how can functional test engineers improve their abilities step by step?
A brief introduction to the showDatePicker method of the basic components of Flutter
【C语言】预处理操作
Understanding and Using Unity2D Custom Scriptable Tiles (4) - Start to build a custom tile based on the Tile class (below)
Redis实现分布式锁
Based on the local, linking the world | Schneider Electric "Industrial SI Alliance" joins hands with partners to go to the future industry
随机推荐
STM32 problem collection
(四)递归、可变参数、访问修饰符、理解 main 方法、代码块
els 方块向右移
(4) Recursion, variable parameters, access modifiers, understanding main method, code block
安全20220715
IDEA comment report red solution
Database implements distributed locks
"A daily practice, happy water problem" 1331. Array serial number conversion
5. How does the SAP ABAP OData service support the $filter operation
Select the smoke test case, and make the first pass for the product package entering QA
从滴滴罚款后数据治理思考
endian mode
顺序表的实现
SQL Interview Questions (Key Points)
Analysis summary - self-use
《DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction》论文笔记
Just debuted "Fight to Fame", safety and comfort are not lost
Redis uses LIST to cache the latest comments
Know the showTimePicker method of the basic components of Flutter
Detailed explanation of TCP (2)