level 4
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses System.SysUtils;
var Money,i,j,t:longint;
begin readln(Money); for i := 0 to Money div 5 do for j := 0 to (Money - i) div 3 do if i+j+(Money - i*5 - j*3 )*3 = Money then begin write('We can buy ', i ,' roosters ', j ); writeln(' hens and ', (Money - i*5 - j*3 )*3, ' chicks.'); end; readln;
end.
自己输出到文件.....骚年
2012年08月03日 08点08分