当前位置:网站首页>Convert the decimal positive integer m into the number in the forward K (2 < =k < =9) system and output it in bits
Convert the decimal positive integer m into the number in the forward K (2 < =k < =9) system and output it in bits
2022-06-26 16:45:00 【Muzi..】
#include<stdio.h>
#include<stdlib.h>
void fun(int m,int k);
int main()
{
int b,n;
printf("\n please enter a number and a base:\n");
scanf("%d %d",&n,&b);
fun(n,b);
printf("\n");
}
void fun(int m,int k)
{
int aa[20],i;
for(i=0;m;i++)
{
aa[i]=m%k;
m=m/k;
}
for(;i;i--)
{
printf("%d",aa[i-1]);
}
}
边栏推荐
- Scala 基礎 (二):變量和數據類型
- Interpretation of cloud native microservice technology trend
- day10每日3题(1):逐步求和得到正数的最小值
- C语言所有知识点小结
- MS | Xie Liwei group found that mixed probiotics and their metabolites could alleviate colitis
- Scala Basics (II): variables and data types
- Overall context of concurrent programming
- Least squares system identification class II: recursive least squares
- STM32F103C8T6实现呼吸灯代码
- 精致妆容成露营“软实力”,唯品会户外美妆护肤产品销量激增
猜你喜欢
Pybullet robot simulation environment construction 5 Robot pose visualization
TCP congestion control details | 1 summary
Exquisite makeup has become the "soft power" of camping, and the sales of vipshop outdoor beauty and skin care products have surged
JUnit unit test
[matlab project practice] prediction of remaining service life of lithium ion battery based on convolutional neural network and bidirectional long short time (cnn-lstm) fusion
Niuke programming problem -- dynamic programming of must brush 101 (a thorough understanding of dynamic programming)
pybullet机器人仿真环境搭建 5.机器人位姿可视化
建立自己的网站(16)
基于STM32+华为云IOT设计的云平台监控系统
Kubecon China 2021 Alibaba cloud special session is coming! These first day highlights should not be missed
随机推荐
How to separate jar packages and resource files according to packaging?
Notes on key review of software engineering at the end of the term
当一个程序员一天被打扰 10 次,后果很惊人!
Several forms of buffer in circuit
Count the number of words in a line of string and take it as the return value of the function
并发编程整体脉络
Binary array command of redis
Kept to implement redis autofailover (redisha) 1
Redis 概述整理
Leetcode 1169. 查询无效交易(如果数据量不大,这种题还是得暴力枚举解决)
Use the array to calculate the average of N numbers, and output the numbers greater than the average
Scala 基礎 (二):變量和數據類型
Some instance methods of mono
num[i]++
LeetCode Algorithm 24. Exchange the nodes in the linked list in pairs
100+数据科学面试问题和答案总结 - 基础知识和数据分析
Mono 的一些实例方法
国内首款开源 MySQL HTAP 数据库即将发布,三大看点提前告知
Acid of redis
【力扣刷题】11.盛最多水的容器//42.接雨水