24/04/07

SOLUZIONE..

Eccovi la soluzione in Pascal del quesito della Susi:
Program Susi 854;
uses crt;
const s=20,r=9,t=6;
var a,x,y,z:integre;e:boolean;
begin
a:=1001;
repeat dec(a);e:=false;
for x:=0 to a div r do
for y:=0 to a div s do
for z :=0 to a div t do
if x*r+y*s+z*t =a
then e=true;
write not(e);
writeln (a);
end.

Nessun commento: