Cấu trúc tổng quát của một chương trình Pascal

Thứ năm - 23/07/2020 11:11
Một chương trình viết bang Pascal nếu đầy đủ thì gồm có các phần sau: Tên chương trình, Chương trình con, thân chương trình chính, kết thúc chương trình.
1. Một chương trình viết bang Pascal nếu đầy đủ thì gồm có các phần sau:
PROGRAM TÊN_CHƯƠNG_TRÌNH (Tiêu đề)
{Phần khai báo dữ liệu}
         LABEL...
         CONST...
         TYPE...
         VAR...
{Phần mô tả chương trình con}
         PROCEDURE...
        FUNCTION...
{Thân chương trình chính}
        BEGIN
{Các lệnh được viết ở đây}
        END
{Kết thúc chương trình}

2. VÍ DỤ
Program PT_bậc_2 ;
Var a, b, c, x1, x2, Delta : Real ;
     Procedure NHAP ;
Begin
        Writeln (Giải phương trình bậc 2 : ax2 + bx + c = 0’);
        Write (nhập a, b, c);
        Readln (a, b, c) ;
End ;
BEGIN
         Nhap ;
         If a = 0 then Writeln (a = 0 - không giải)
         Else {a <>0}
              Begin
                  Delta := sqr(b) - 4*a*c ;
                  If Delta < 0 then Writeln (‘vô nghiệm’)
                  Else
                      if Delta = 0 then
                         Begin
                         x1 := -b/2/a ;
                         Writein ('Nghiệm kép :’ , , x1);
                  end ;
         else {Delta >0}
                 Begin
                     x1 := (-b-sqrt(delta))/2/a ;
                     x2 := -b/a – x1 ;
                    Writeln (‘x1 =’ , x1 , ‘x2 =' , x2);
                  end ;
        end ;
END.

  Ý kiến bạn đọc

THÀNH VIÊN

Hãy đăng nhập thành viên để trải nghiệm đầy đủ các tiện ích trên site
Kênh Bóng đá trực tiếp hôm nay miễn phí
Kênh
90Phut TV full HD
leo88 ⇔ hb 88 ⇔ go88 ⇔ BET88

https://go88live.net/ ⇔ https://69vn.living/
Link MB66 ⇔ U888 ⇔ ABC88
link xem truc tiep bong da xoilac tv ⇔ https://104.248.99.177/
xem bóng đá cà khịa tv trực tuyến hôm nay
 ⇔ hi88 ⇔ qq88 ⇔ TK88
https://hi88.tours/ ⇔ 789BET ⇔ 
789BET ⇔ BJ88 ⇔ 789bet ⇔ hitclub
ok9 ⇔ QQ88 ⇔ qq 88 ⇔ OK9
https://789betcom0.com/ ⇔ https://hi88.baby/
https://f168.blue/ ⇔ sunwin
QQ88 ⇔  ⇔ 
789club ⇔ 78WIN
8kbet ⇔ sunwin
https://789club64.com/ ⇔ 
18win ⇔ https://fun88.social/
  ⇔  ⇔ QQ88
Rikvip ⇔ hi88 ⇔ 
https://go88so.net/ ⇔ https://f168.law/
 ⇔ https://789club63.com/
 ⇔ hi88 ⇔ 
 ⇔ 
https://f168.dad/
https://qq88.fun/ ⇔ 
 ⇔  ⇔ 
nhà cái net88
s666 ⇔ https://kubetvn88.com/
https://f168.guide/ ⇔ https://uk88.rocks
https://8xbet68.net/ ⇔ https://789bet188.com/
https://shbetb0.com/ ⇔ https://hello8880.net/
sunwin ⇔  ⇔ hi88 ⇔ qh88 com
 ⇔ f168 ⇔ https://qq88.marketing/
F168 ⇔ new88 ⇔ 
https://mb66az.com/ ⇔ 
Link vào NEW88 ⇔ https://789club24.com/
https://33win103.com/ ⇔ 
https://888bz.vip ⇔ 
https://33win102.com/ ⇔ 
https://33win100.com/ ⇔ 
https://ww88.supply/ ⇔ https://hi88.report/
https://58win1.info/ ⇔ Hi88
https://789bet188.us/ ⇔ https://hello880.net/
https://789club60.com/ ⇔ 
shbet ⇔ cwin ⇔ 68gamebai
qh88 đăng nhập ⇔ https://789club24.com/
78win ⇔ 8xbet com
 ⇔  ⇔ BAY789
https://go88club13.com/https://789bet188.today/
https://bk8link2.com/ ⇔ https://bk8link3.com/
https://789bet188.xyz/ ⇔ https://jun88pro.club/
https://33win101.com/ ⇔ SHBET
 ⇔ https://hi88.gives/
 ⇔ https://789bet188.pro/
 ⇔ https://789bet188.cloud/
 ⇔ https://nohu90m.net/
 ⇔ https://bj8884.com/
https://789bet188.info/ ⇔ https://789bet188.live/
https://789bet188.online/ ⇔ https://789bet188.co/
https://789bet188.tech/ ⇔ https://789bet188.biz/
https://789bet188.club/ ⇔ https://789bet188.vip/
https://789bet188.site/ ⇔ https://789bet.asia/
https://new8822.com/ ⇔ https://new8818.org/
https://new8818.me/ ⇔ https://new8818.xyz/
https://new8818.pro/ ⇔ https://new8818.cloud/
https://new8818.info/ ⇔ https://new8818.us/
https://new8818.live/ ⇔ https://new8818.online/
https://new8818.co/ ⇔ https://new8818.today/
https://new8818.biz/ ⇔ https://new88820.com/
https://new8818.vip/ ⇔ https://new8818.site/
https://new8818.ink/ ⇔ https://ahihi88.host/
https://hi8818.xyz/ ⇔ https://hi8818.us/
https://hi8818.blog/ ⇔ https://hi8818.online/
https://hi8818.site/ ⇔ https://hi8818.ink/
https://hi8818.cloud/ ⇔ https://hi8818.me/
https://shbet188.org/ ⇔ https://shbet188.pro/
https://shbet188.cloud/ ⇔ https://shbet188.ink/
https://shbet288.store/ ⇔ https://shbet288.today/
https://shbet288.tech/ ⇔ https://shbet188.xyz/
https://shbet188.us/ ⇔ https://shbet188.shop/
https://kubet288.com/ ⇔ https://kubet188.mobi/
https://kubet188.dev/ ⇔ https://kubet288.xyz/
https://kubet288.pro/ ⇔ https://kubet288.cloud/
https://jun8818.org/ ⇔ https://jun8818.net/
https://jun8818.me/ ⇔ https://jun8818.xyz/
https://jun8818.pro/ ⇔ https://jun8818.cloud/
https://jun8818.info/ ⇔ https://jun8818.us/
https://jun8818.live/ ⇔ https://jun8818.shop/
https://loteriadeboyaca.com.co/
https://f8bet288.com/ ⇔ https://f8bet288.org/
https://f8bet288.net/ ⇔ https://f8bet288.me/
https://f8bet288.xyz/ ⇔ https://f8bet288.pro/
https://f8bet288.cloud/ ⇔ https://f8bet288.info/
https://f8bet288.us/ ⇔ https://f8bet288.live/
https://f8bet288.online/ ⇔ https://f8bet288.co/
https://f8bet288.today/ ⇔ https://f8bet288.biz/
Bạn đã không sử dụng Site, Bấm vào đây để duy trì trạng thái đăng nhập. Thời gian chờ: 60 giây