森林家园新浪分站 森林家园163分站
Calendar
网志中国数据载入中...
Category
网志中国数据载入中...
Latest Entries
网志中国数据载入中...
Latest Comments
网志中国数据载入中...
Last Messages
网志中国数据载入中...
User Login
网志中国数据载入中...
Links
Information
网志中国数据载入中...
Other


森林家园,打造个人博客门户
  [6.28]Pascal 基本练习题三道 含解答
 

1\100多个零件 三个三个数多二个 五个五个数多3个 七个七个数多五个 请问至少多少个?

Program ex;
var
total,min:integer;
begin
min:=199;
For total:=100 to 199{100多个} do
If (total mod 3 =2) and (total mod 5=3) and (total mod 7=5) and

(total<min) then min:=total;
write(min);
end.

2\2-1000内的完数

Program ex1;
var
a,b,c:integer;
begin
for a:=2 to 1000 do
begin
c:=0;
For b:= 1 to a-1 do
If a mod b =0 then s:=s+b;
If a=c then begin write(a,'=',1);
for b:=2 to a-1 do
If a mod b = 0 then write('+',b) ;
writeln;
end;
end;
end.

3\输出

                                                   A

                                          A               B

                                A               B               C

                     .                                                      .

           A           B......................................... Y             Z

Program ex;
var
i,c,m:integer;
begin
for i:=1 to 26 do
begin
 for m:=26 to i do write(' ');
 for m:=1 to i  do
write(chr(m+96),'           ');
writeln;
end;
end.

 

 

                                            版权所有:森林家园PASCAL工作室 欢迎指正

[ 阅读全文 | 回复(0) | 引用通告 | 编辑

  Post  by  森林之王 发表于 2008-6-28 15:04:00
发表评论:
网志中国数据载入中...
网志中国数据载入中...

                                                                         

                                                                  客户服务热线:0511-88331845