uses crt; type alph = array [0..15] of char; const binalph : alph=('0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); octalph : alph=('0','1','2','3','4','5','6','7','0','0','0','0','0','0','0','0'); hexalph : alph=('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); var e:integer; function conv(dc:integer;base:byte;al:alph):string; var tmp,tmp1:string; fr:integer; begin tmp:='';fr:=dc; while fr > base do begin tmp:=al[fr mod base]+tmp; fr:=fr div base; end; tmp:=al[fr]+tmp; if tmp[1] in ['A','B','C','D','E','F'] then tmp:='0'+tmp; conv:=tmp; end; function getintgr(x,y:byte):integer; var code,value:integer; tmp:string; begin repeat gotoxy(x,y);clreol; write('Введи целое десятичное: ');readln(tmp); val(tmp,value,code); until code=0; getintgr:=value; end; begin clrscr; e:=getintgr(4,1); clrscr; writeln(' Шестнадцатеричная: ',conv(e,16,hexalph)); writeln(' Десятичная: ',e); writeln(' Восьмеричная: ',conv(e,8,octalph)); writeln(' Двоичная: ',conv(e,2,binalph)); readkey; end.