14.10.06

Programma cambio

program chf;
uses crt;
const f=0.6313;
t:array[1..5] of real=(10,5,2,1,0.5);
var n,i,q:byte;
c:real;
begin
write('N[CHF] : ');
for i:=1 to 4 do write(t[i]:2:0);
writeln(t[5]:4:1);
for n:=1 to 21 do begin
c:=f*n;
write(c:5:2,'= ');
for i:=1 to 5 do begin
q:=trunc(c/t[i]);
write(q:2);
c:=c-q*t[i];
end;
readln;
end;
end.

Nessun commento: