实现进制转化伪代码的C语言转化
#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;
}![]() 
 


 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号