搜索

实现进制转化伪代码的C语言转化


发布时间: 2022-11-24 17:36:04    浏览次数:42 次
#include <stdio.h>
int main()
{
    int x,p;
    printf("Enter the new base");
    scanf("%d",&p);
    printf("Enter the number to be converted");
    scanf("%d",&x);
    int a[100];
    int count=0;
    do
    {
        a[count++]=x%p;
        x=x/p;
    }
    while(x!=0);
   
    for(int i=count-1;i>=0;i--)
    {
        printf("%d",a[i]);
    }
    return 0;
}

 

免责声明 实现进制转化伪代码的C语言转化,资源类别:文本, 浏览次数:42 次, 文件大小:-- , 由本站蜘蛛搜索收录2022-11-24 05:36:04。此页面由程序自动采集,只作交流和学习使用,本站不储存任何资源文件,如有侵权内容请联系我们举报删除, 感谢您对本站的支持。 原文链接:https://www.cnblogs.com/cjs20030409/p/16766618.html