Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted by F1_GTR ( 15 years ago )
program perevod v;
var
a,b,f,i,n:integer;
res:string;
pv:array[1..255] of integer;
begin
//vvod dannih
writeln('Vvedite chislo v desatichnoy sisteme schisleniya');
readln(a);
writeln('Vvedite osnovanie otveta');
readln(n);
//perevod
f:=1;
b:=a;
while b >= n do begin
pv[f]:=b mod n;
b:=b div n;
writeln(b,' ',pv[f]);
f:=f +1;
end;
pv[f]:=b;
//povorot otveta s preobrazovaniem chisel > 9 v bykvi
f:=f+1;
for i:=f-1 downto 1 do begin
if pv[i] = 10 then res:=res+'A';
if pv[i] = 11 then res:=res+'B';
if pv[i] = 12 then res:=res+'C';
if pv[i] = 13 then res:=res+'D';
if pv[i] = 14 then res:=res+'E';
if pv[i] = 15 then res:=res+'F';
if pv[i] < 10 then res:=res+IntToStr(pv[i]);
end;
write(res);
end.
Revise this Paste