码迷,mamicode.com
首页 > Windows程序 > 详细

Delphi 控制台程序

时间:2014-12-10 14:04:43      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   sp   for   on   

 

新建控制台程序: File--> New -->Other --> console Application

 

 1 program Project1;
 2 
 3 {$APPTYPE CONSOLE}
 4 
 5 uses
 6   SysUtils;
 7 var
 8  a,b,sum:Integer;
 9  
10  procedure jiujiuTable();
11  var
12     i,j:Integer;
13  begin
14   for i:=1 to 9 do
15    begin
16      for j:=1 to i do
17       write(j:3,*,i,=,i*j:2);
18      Writeln;
19    end;
20  end;
21 
22  function add(a,b:Integer):Integer;
23  begin
24    Result:=a+b;
25  end;
26 
27 
28 
29 begin
30   write(输入a: );
31   Readln(a);
32   write(输入b: );
33   Readln(b);
34   sum:=add(a,b);
35   Writeln(a+b=,sum);
36 
37   Writeln(九九乘法表:);
38   jiujiuTable();
39   Readln;     //等待输入,用户输入字符后按回车将会退出(如果没有这个函数,上面那句在屏幕输出字符后一闪就退出了)
40 
41 end.

 

运行效果:

bubuko.com,布布扣

 

Delphi 控制台程序

标签:style   blog   http   io   ar   color   sp   for   on   

原文地址:http://www.cnblogs.com/thrive/p/4155259.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!