当前位置:网站首页>[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~~
边栏推荐
- Bubble sort, selection sort, insertion sort, binary search directly
- Ambiguous method call.both
- (六)枚举、注解
- 数据库实现分布式锁
- Redis 使用 sorted set 做最新评论缓存
- SIP协议标准和实现机制
- (4) Recursion, variable parameters, access modifiers, understanding main method, code block
- 5. How does the SAP ABAP OData service support the $filter operation
- ClickHouse:设置远程连接
- [Paper reading] Mastering the game of Go with deep neural networks and tree search
猜你喜欢

type_traits metaprogramming library learning

A brief introduction to the CheckboxListTile component of the basic components of Flutter

"A daily practice, happy water problem" 1331. Array serial number conversion

识Flutter 基本组件之showTimePicker 方法
![[Compilation principle] Design principle and implementation of recursive descent parsing](/img/51/cd054a8246dc108520d6ff9ea26c60.png)
[Compilation principle] Design principle and implementation of recursive descent parsing

STM32 problem collection

(4) Recursion, variable parameters, access modifiers, understanding main method, code block

一份高质量的测试用例如何养成?

Based on the local, linking the world | Schneider Electric "Industrial SI Alliance" joins hands with partners to go to the future industry

No qualifying bean of type 问题
随机推荐
《DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction》论文笔记
BP神经网络
"A daily practice, happy water problem" 1331. Array serial number conversion
Pytest e-commerce project combat (on)
【CocosCreator 3.5】CocosCreator get network status
[Compilation principle] Design principle and implementation of recursive descent parsing
【动态规划】连续子数组的最大和
Golang中的addressable
安全20220712
How to develop a high-quality test case?
What is a system?
ClickHouse:设置远程连接
数据库实现分布式锁
[shell basics] determine whether the directory is empty
【C语言】预处理操作
(4) Recursion, variable parameters, access modifiers, understanding main method, code block
Ambiguous method call.both
Detailed explanation of TCP and UDP
The BP neural network
els block to the right