#define_crt_secure_no_warnings#include<stdlib.h>#include<stdio.h>#include<string.h>voidTO2STR (intNumintIChar*str2) { if(num = =0) { return; } Else{to2str (num/2, i+1, STR2); Str2[i]= (num%2) +'0'; }}voidTO8STR (intNumintIChar*str8) { if(num = =0) { return; } Else{to8str (num/8, i+1, STR8); Str8[i]= (num%8) +'0'; }}voidTO16STR (intNumintIChar*str16) { if(num = =0) { return; } Else{to16str (num/ -, i+1, str16); if(num% -<Ten) {Str16[i]= (num% -) +'0'; } Else{Str16[i]= (num% -) -Ten+'A'; } }}voidMain () {Charstr2[ +] = {0 }; Charstr8[ +] = {0 }; Charstr16[ +] = {0 }; intnum =0; scanf ("%d", &num); TO2STR (num,0, STR2); _strrev (STR2); TO8STR (num,0, STR8); _strrev (STR8); TO16STR (num,0, str16); _strrev (STR16); printf ("\n%s", STR2); printf ("\n%s", STR8); printf ("\n%s", str16); System ("Pause");}
Recursive binary conversion _strrev