首 页健康生活新 闻留 言骗 子美女图片网络安全论 坛问吧注册码大全bt资源
张筱雨人体艺术   汤芳人体艺术  汤加丽人体艺术  石靖人体艺术   刘亦菲人体艺术   汤唯人体艺术  张柏芝人体艺术   人体艺术摄影
人体艺术摄影        BODY ART PHOTOGRAPHY
                                           Human essence of art, the human feelings of the perfect lens
首页
您当前的位置:地球村问吧电脑技术编程语言 → 问吧内容 设为首页   加入收藏   联系我们
汉诺塔编程语言怎么做啊(只到5个就OK了)要移动5个
作者:meilibao  来源:地球村  发布时间:2007-8-15 18:30:33
Body art from the West, male body is mainly a reflection of the strength of the United States. While the female body is mainly a reflection of the kind of a female-specific negative of tender.
Body art is static human form, does not contain sexual intercourse is exposed genitals or other to tease of limb movements. Good photographs focus on the human body is the use of light and shadow. The body was naked from the arts, the human body art is not carnal desire , vulgar. Accurately speaking, and now, the "body art" is not very precise. Art classification is based on the auditory,
汉诺塔编程语言怎么做啊(只到5个就OK了)要移动5个
悬赏分:10 - 解决时间:2007-8-15 16:48
汉诺塔编程语言
用PASCAL编程语言来解决5个盘子的移动
还要记录AA 给10个积分哦
8856
最佳答案
Program hanoi;
var n,t:integer;

procedure hanoi(n,a,b,c:integer);
begin
if n=1 then begin
t:=t+1;
writeln('step.',t,': ',a,'------>',b);
end
else begin
hanoi(n-1,a,c,b);
t:=t+1;
writeln('step.',t,': ',a,'------>',b);
hanoi(n-1,c,b,a);
end;
end;

begin{main}
assign(input,'hanoi.in');
reset(input);
assign(output,'hanoi.out);
rewrite(output);
readln(n);
t:=0;
hanoi(n,1,2,3);
end.
这是递推递归的基础,你是初学者吧
回答者:shizechen - 兵卒 一级 8-13 11:58
提问者对于答案的评价:
谢谢啦
我10分满意
您觉得最佳答案好不好?目前有 1 个人评价

100% (1)

0% (0)
对最佳答案的评论
hai 还是不太懂没笔!奥
在最后加入WRITE(T)是不是更好了 还可以记录用了多少步;是mang ?
我知道了
[ ] [返回上一页] [打 印]
Copyright © 2007 Diqiuc.Com. All Rights Reserved .豫ICP备07001840 Powered by Diqiuc.Com