1 solutions
-
0
Pascal :
var a:array[1..100] of char; n:integer; procedure change(k:integer); var s,y1,i,t:integer; y2:char; begin s:=n; t:=0; while s<>0 do begin inc(t); y1:=s mod k; if y1<10 then a[t]:=chr(ord('0')+y1); if y1>=10 then a[t]:=chr(ord('A')+y1-10); s:=s div k; end; for i:=t downto 1 do write(a[i]); writeln; end; begin readln(n); change(2); change(8); change(16); end.
- 1
Information
- ID
- 16653
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By