free pascal题目

[复制链接]
查看11 | 回复3 | 2013-4-9 12:33:53 | 显示全部楼层 |阅读模式
var a,b,c:integer;beginwriteln('cock':6,'hen':6,'chick':6);for a:=0 to 20 do
for b:=0 to 100-5*a do
begin
c:=100-a-b;
if (c mod 3=0)and(5*a+3*b+c div 3=100) then
writeln(a:5,b:6,c:6);
end;end....
回复

使用道具 举报

千问 | 2013-4-9 12:33:53 | 显示全部楼层
program chickenmony;{允许一 只都不买}for i:=0 to 100 div 5 do {公鸡=i}for j=0 to100 div 3 do begin {小鸡 =j*3}k=100-i-j*3;
{母鸡=k}
if k<0 continue;if(5...
回复

使用道具 举报

千问 | 2013-4-9 12:33:53 | 显示全部楼层
var i,x,y,z:longint;beginfor x:=0 to 20 dofor y:=0 to 33 dofor z:=0 to 100 doif (x+y+z=100) and (x*5+y*3+z*1/3=100) then writeln(x,' ',y,' ',z,' '); end....
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行