File:  [CSRG BSD Unix] / 43BSDReno / pgrm / pascal / tstpx / src / t04.p
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:57 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

program roman(output);
var
	x,y: integer;
begin
	y := 1;
	repeat
		x := y;
		write(y, ' ');
		while x >= 1000 do
		begin
			write('m');
			x := x-1000
		end;
		while x >= 500 do
		begin
			write('d');
			x := x-500
		end;
		while x >= 100 do
		begin
			write('c');
			x := x-100
		end;
		if x >= 50 then
		begin
			write('l');
			x := x-50
		end;
		while x >= 10 do
		begin
			write('x');
			x := x-10
		end;
		if x >= 5 then
		begin
			write('v');
			x := x-5
		end;
		while x >= 1 do
		begin
			write('i');
			x := x-1
		end;
		writeln;
		y := 2*y;
	until y > 5000
end.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.