#include<iostream.h>#include<math.h>intmain(){charch[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'},output[20];intinput,temp,n,i=0;cout<<"請(qǐng)輸入你想要轉(zhuǎn)換的十進(jìn)制數(shù):";cin>>input;cout<<"請(qǐng)輸入要轉(zhuǎn)換的進(jìn)制(2<=n<=16):";cin>>n;input=fabs(input);while(input){temp=input%n;input=input/n;output[i++]=ch[temp];}output[i]='\0';cout<<"轉(zhuǎn)換為"<<n<<"進(jìn)制后為:";for(;i>=0;i--)cout<<output[i];cout<<endl;return0;}
網(wǎng)站導(dǎo)航
- zblogPHP模板zbpkf
- zblog免費(fèi)模板zblogfree
- zblog模板學(xué)習(xí)zblogxuexi
- zblogPHP仿站zbpfang