69,373
社区成员
发帖
与我相关
我的任务
分享
string str="0123456789ABCDEF"
void dectohex(int n) {
if (n >=0 && n < 16)
cout << str[n];
else {
dectooct(n / 16);
cout << str[n % 16];
}
}
void dectooct(int n) {
if (n >=0 && n < 8)
cout << n;
else {
dectooct(n / 8);
cout << n % 8;
}
}
void dectooct(int n) {
if (n >= 0 && n < 8)
cout << n;
else {
dectooct(n / 8);
cout << n % 8;
}
}