当前位置:网站首页>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]);
}
}
边栏推荐
- Redis migration (recommended operation process)
- Binary array command of redis
- [Li Kou brush question] monotone stack: 84 The largest rectangle in the histogram
- [机缘参悟-31]:鬼谷子-抵巇[xī]篇-危机是危险与机会并存
- 【力扣刷题】11.盛最多水的容器//42.接雨水
- 1-12Vmware新增SSH功能
- 牛客编程题--必刷101之动态规划(一文彻底了解动态规划)
- GUI+SQLServer考试系统
- 并发编程整体脉络
- [force deduction question] two point search: 4 Find the median of two positive arrays
猜你喜欢

Cloud platform monitoring system based on stm32+ Huawei cloud IOT design

Supplement the short board - Open Source im project openim about initialization / login / friend interface document introduction
![[graduation season] a word for graduates: the sky is high enough for birds to fly, and the sea is wide enough for fish to leap](/img/b6/21e51fa7f79d4a4b950f061703f0fb.png)
[graduation season] a word for graduates: the sky is high enough for birds to fly, and the sea is wide enough for fish to leap

对话长安马自达高层,全新产品将在Q4发布,空间与智能领跑日系

长安链交易防重之布谷鸟过滤器

Niuke programming problem -- dynamic programming of must brush 101 (a thorough understanding of dynamic programming)

建立自己的网站(16)

进军AR领域,这一次罗永浩能成吗?

R329 (maix-ii-a (M2A) data summary

JUnit unit test
随机推荐
Redis order sorting command
Day10 daily 3 questions (2): count the number of the largest groups
Cloud platform monitoring system based on stm32+ Huawei cloud IOT design
[207] several possible causes of Apache crash
Multiply the values of the upper triangular elements of the array by M
Pybullet robot simulation environment construction 5 Robot pose visualization
构造函数和析构函数
Memory partition model
JS tutorial - printing stickers / labels using the electronjs desktop application
Count the number of each vowel letter in the string
Binary array command of redis
5G未平6G再启,中国引领无线通信,6G的最大优势在哪里?
GUI+SQLServer考试系统
数据分析----numpy快速入门
Several forms of buffer in circuit
基於Kubebuilder開發Operator(入門使用)
Qt 5.9.8 安装教程
Scala Basics (II): variables and data types
TCP拥塞控制详解 | 1. 概述
Dialogue with the senior management of Chang'an Mazda, new products will be released in Q4, and space and intelligence will lead the Japanese system