色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

用C或者C++編程,輸入一個(gè)10進(jìn)制正整數(shù),然后輸出它所對(duì)應(yīng)的八進(jìn)制、十六進(jìn)制數(shù).(不能直接用%0和%x來輸出?

#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;}