Bài tập PCALC2
Chia sẻ bởi Nguyễn Văn Hoán |
Ngày 25/04/2019 |
62
Chia sẻ tài liệu: Bài tập PCALC2 thuộc Tin học 11
Nội dung tài liệu:
Bài 1 :
Program Thu_tuc_chuan;
Uses Crt;
Var
so1,so2,tong,hieu,tich:Integer;
thuong:Real;
Begin
ClrScr;
TextColor(Red);
TextBackGround(Black);
Writeln(`SU DUNG CAC THU TUC CHUAN`);
TextColor(Yellow);
TextBackGround(Blue);
Write(`-Nhap so thu nhat: `);
Readln(so1);
TextColor(Green);
TextBackGround(White);
Write(`-Nhap so thu hai: `);
Readln(so2);
ClrScr;
TextColor(Magenta);
TextBackGround(Black);
GotoXY(31,10);
Writeln(`KET QUA TINH TOAN`);
GotoXY(25,12);
TextColor(Cyan);
TextBackGround(Black);
Writeln(`+Tong cua 2 so `,so1,` va `,so2,` = `,so1+so2);
GotoXY(25,13);
TextColor(Red);
TextBackGround(Black);
Writeln(`+Hieu cua 2 so `,so1,` va `,so2,` = `,so1-so2);
GotoXY(25,14);
TextColor(Yellow);
TextBackGround(Black);
Writeln(`+Tich cua 2 so `,so1,` va `,so2,` = `,so1*so2);
GotoXY(25,15);
TextColor(Green);
TextBackGround(Black);
Writeln(`+Thuong cua 2 so `,so1,` va `,so2,` = `,so1/so2:6:2);
GotoXY(26,22);
TextColor(Red);
TextBackGround(Black);
Writeln(`Bam phim de ket thuc`);
Readln;
ClrScr;
End.
Bài 2 :
Program Thu_tuc_tu_tao;
Uses Crt;
Procedure Ve(k:Integer; Kytu:Char);
Var
i:Integer;
Begin
For i:=1 To k Do
Write(kytu);
Writeln;
End;
Begin
ClrScr;
Textcolor(Yellow);
TextBackGround(Black);
Writeln(` THU TUC TU TAO`);
Writeln;
Textcolor(Red);
TextBackGround(Black);
Ve(50,`*`);
Textcolor(Green);
TextBackGround(Black);
Ve(50,`A`);
Textcolor(Cyan);
TextBackGround(Black);
Ve(50,`+`);
Textcolor(Magenta);
TextBackGround(Black);
Ve(50,`B`);
Textcolor(Cyan);
TextBackGround(Black);
Ve(50,`=`);
Textcolor(Green);
TextBackGround(Black);
Ve(50,`C`);
Textcolor(Red);
TextBackGround(Black);
Ve(50,`*`);
Writeln;
Textcolor(Blue);
TextBackGround(Black);
Writeln(` Bam phim de ket thuc`);
Readln
End.
Bài 3:
Program Ham_chuan;
Uses Crt;
Begin
ClrScr;
TextColor(Red);
TextBackGround(Black);
Writeln(`HE THONG CAC HAM CHUAN DA HOC`);
Writeln(`-----------------------------`);
TextColor(Yellow);
TextBackGround(Black);
Writeln(` +Cac ham ung dung voi so nguyen`);
Writeln(`-X=5,Ham Pred(X) = `,Pred(5)); {--> 4}
Writeln(`-X=5,Ham Succ(X) = `,Succ(5)); {--> 6}
Writeln(`-X=-5,Ham Abs(X) = `,Abs(5)); {--> 5}
Writeln(`-X=10,Ham Sqr(X) = `,Sqr(10)); {-->100}
Writeln(`-X=16,Ham Sqrt(X) = `,Sqrt(16):0:0); {-->4}
Writeln(`-X=3,Ham Odd(X) = `,Odd(3)); {-->True}
Writeln(`-X=3.1416,Ham Trunc(X) = `,Trunc(3.1416)); {-->3}
Writeln;
Writeln(` Bam phim de xem tiep`);
Readln;
TextColor(White);
TextBackGround(Black);
ClrScr;
TextColor(Cyan);
TextBackGround(Black);
Writeln(` +Cac ham ung dung voi so thuc`);
Writeln(`-X=3.1416,Ham Round(X) = `,Round(3.1416)); {-->3}
Writeln(`-Ham Pi co tri bang = `,pi); {-->3.1415926536E+00}
Writeln(`-X=3.1416,Ham Frac(X) = `,Frac(3.1416)); {-->1.14160000000E-01}
Writeln(`-X=3.1416,Ham Int(X) = `,Int(3.1416):0:0); {-->3}
TextColor(Magenta);
TextBackGround(Black);
Writeln(` +Cac ham ung dung voi kieu Boolean`);
Writeln(`-Ham Ord(false) = `,Ord(false)); {--> 0}
Writeln(`-Ham Ord(True) = `,Ord(true)); {--> 1}
Writeln(`-Ham Pred(True) = `,Pred(true)); {--> FALSE}
Writeln(`-Ham Pred(False) = `,Pred(False)); {--> TRUE}
Writeln(`-Ham Succ(False) = `,Succ(False)); {--> TRUE}
Writeln(`-Ham Succ(True) = `,Succ(True)); {--> FALSE}
Writeln;
Writeln(` Bam phim de xem tiep`);
Readln;
TextColor(White);
TextBackGround(Black);
ClrScr;
TextColor(LightBlue);
TextBackGround(Black);
Writeln(` +Cac ham va thu tuc ung dung voi kieu ky tu`);
Writeln(`-Ham Ord("A") = `,Ord(`A`)); {--> 65}
Writeln(`-Ham Chr(66) = `,Chr(66)); {--> `B`}
Writeln(`-Ham Chr(Ord("A") = `,Chr(Ord(`A`))); {--> `A`}
Writeln(`-Ham Pred("B") = `,Pred(`B`)); {--> `A`}
Writeln(`-Ham Succ("B") = `,Succ(`B`)); {--> `C`}
Writeln(`-Ham Upcase("a") = `,Upcase(`a`)); {--> `A`}
Writeln;
TextColor(Red);
TextBackGround(Black);
Writeln(` Bam phim de ket thuc`);
Readln
End.
Bài 4 :
Program Ham_tu_tao;
Uses Crt;
Var
n:Integer;
Function giaithua(M :Integer):LongInt;
Var
i,gt:Integer;
Begin
gt:=1;
For i:=1 To M Do
gt:=gt*i;
Writeln(`+Giai thua cua `,m,` la: `,gt);
End;
BEGIN
ClrScr;
TextColor(Red);
TextBackGround(Black);
Writeln(`HAM TINH GIAI THUA TU TAO`);
Writeln(`-------------------------`);
TextColor(Yellow);
TextBackGround(Black);
Write(`-Nhap so N = `);
Readln(n);
TextColor(Magenta);
TextBackGround(Black);
giaithua(n);
Writeln;
TextColor(Cyan);
TextBackGround(Black);
Writeln(` Bam phim de ket thuc`);
Readln
END.
Bài 1 :
Program Phep_tinh_so_hoc;
Var
x,y:Integer;
phep_tinh,tiep:Char;
(*---------------------*)
FUNCTION CONG(a,b:Integer):Integer;
Begin
cong:=a+b;
End;
(*---------------------*)
FUNCTION TRU(a,b:Integer):Integer;
Begin
tru:=a-b;
End;
(*---------------------*)
FUNCTION NHAN(a,b:Integer):Integer;
Begin
nhan:=a*b;
End;
(*---------------------*)
FUNCTION CHIA(a,b:Integer):Integer;
Begin
chia:=a DIV b;
End;
BEGIN
Repeat
Writeln(`CAC PHEP TOAN SO HOC`);
Writeln(`--------------------`);
Write(`-Nhap so thu nhat: `);
Readln(x);
Write(`-Nhap so thu hai : `);
Readln(y);
Write(`-Nhap phep tinh (+,-,*,/): `);
Readln(phep_tinh);
Case phep_tinh Of
`+` :Writeln(`+So `,X,` + `,Y,` = `,cong(x,y):5);
`-` :Writeln(`+So `,X,` - `,Y,` = `,tru(x,y):5);
`*` :Writeln(`+So `,X,` * `,Y,` = `,nhan(x,y):5);
`/` :Writeln(`+So `,X,` / `,Y,` = `,chia(x,y):5);
End;
Writeln;
Write(` Co thuc hien tiep khong (c/k) `);
Readln(tiep);
Until Upcase(tiep)=`K`;
END.
Bài 1 :
Program Uoc_so_chung;
Uses Crt;
Var
so1,so2,usc:Integer;
tiep:Char;
(*----------------*)
Procedure gioi_thieu;
Begin
ClrScr;
TextColor(Red);
TextBackGround(Black);
Writeln(`**************************************`);
Writeln(`* MINH HOA CHUONG TRINH CON *`);
Writeln(`* Su khac nhau giua Thu tuc va Ham *`);
Writeln(`* Tim uoc so chung lon nhat cua 2 so *`);
Writeln(`* Ngay viet chuong trinh 24-3-1999 *`);
Writeln(`**************************************`);
Writeln;
End;
(*----------------*)
Procedure Nhap_so;
Var
sua:Char;
Begin
TextColor(Yellow);
TextBackGround(Black);
Repeat
Write(`-Nhap so thu nhat: `);
Readln(so1);
Write(`-Nhap so thu hai : `);
Readln(so2);
TextColor(Cyan);
TextBackGround(Black);
Write(`-Co can sua khong (c/k) ? `);
Readln(sua);
Until Upcase(sua) =`K`;
Writeln;
End;
(*----------------*)
Function uoc_so(x,y:Integer):Integer;
Begin
Repeat
If x > y Then
x:=x-y
Else
y:=y-x;
Until x=y;
usc:=x;
End;
(*----------------*)
Procedure Xuat;
Begin
TextColor(Magenta);
TextBackGround(Black);
Writeln(`+Uoc so chung lon nhat cua`);
Writeln(` So `,so1,` va `,so2,` la: `,usc);
Writeln;
End;
(*----------------*)
BEGIN
Repeat
Gioi_thieu;
Nhap_so;
uoc_so(so1,so2);
Xuat;
TextColor(Green);
TextBackGround(Black);
Write(`-Co thuc hien tiep nua khong (c/k)? `);
Readln(tiep);
Until (tiep = `k`) Or (tiep = `K`);
END.
Bài 1 :
Program Su_dung_ham;
Var
so1,so2,so3,tong:Integer;
(*-----------------------*)
Function tam_thua(x:Integer):LongInt;
Begin
tam_thua:=x*x*x;
End;
BEGIN
Writeln(`CHUONG TRINH CON LA HAM`);
Writeln(`-----------------------`);
Write(`-Nhap so thu nhat: `);
Readln(so1);
Write(`-Nhap so thu hai : `);
Readln(so2);
Write(`-Nhap so thu ba : `);
Readln(so3);
Writeln(`+Tam thua cua so thu nhat (`,so1,`) la: `,tam_thua(so1));
Writeln(`+Tam thua cua so thu hai (`,so2,`) la: `,tam_thua(so2));
tong:=tam_thua(so1) + tam_thua(so2);
Writeln(`+Tong tam thua cua 2 so: `,tong);
If tam_thua(so1) > so3 Then
Writeln(`Tam thua cua so 1 lon hon so `,so3)
Else
Writeln(`+Tam thua cua so 1 nho hon so `,so3);
Readln
END.
Bài 1 :
Program Su_dung_thu_tuc;
Var
so1,so2,so3,tong,y1,y2:Integer;
(*-----------------------*)
Procedure tam_thua(x:Integer;Var y:Integer);
Begin
y:=x*x*x;
End;
BEGIN
Writeln(`CHUONG TRINH CON LA THU TUC`);
Writeln(`---------------------------`);
Write(`-Nhap so thu nhat: `);
Readln(so1);
Write(`-Nhap so thu hai : `);
Readln(so2);
Write(`-Nhap so thu ba : `);
Readln(so3);
tam_thua(so1,y1);
tam_thua(so2,y2);
Writeln(`+Tam thua cua so thu nhat (`,so1,`) la: `,y1);
Writeln(`+Tam thua cua so thu hai (`,so2,`) la: `,y2);
tam_thua(so1,y1);
tam_thua(so2,y2);
tong:=y1+y2;
Writeln(`+Tong tam thua cua 2 so: `,tong);
If y1 > so3 Then
Writeln(`Tam thua cua so 1 lon hon so `,so3)
Else
Writeln(`+Tam thua cua so 1 nho hon so `,so3);
Readln
END.
Bài 1 :
Program Thu_tuc_long_nhau;
Uses Crt;
Var
t:Byte;
tiep:Char;
(*--------------------------------*)
Procedure Giai_tri(x:Integer);
Procedure giai_tri1;
Begin
TextColor(Green);
TextBackGround(Black);
Writeln(`Troi lanh,nen o nha coi TV`);
End;
(*----------------*)
Procedure giai_tri2;
Begin
TextColor(Cyan);
TextBackGround(Black);
Writeln(`Troi mat me,nen di cam trai`);
End;
(*----------------*)
Procedure g
Program Thu_tuc_chuan;
Uses Crt;
Var
so1,so2,tong,hieu,tich:Integer;
thuong:Real;
Begin
ClrScr;
TextColor(Red);
TextBackGround(Black);
Writeln(`SU DUNG CAC THU TUC CHUAN`);
TextColor(Yellow);
TextBackGround(Blue);
Write(`-Nhap so thu nhat: `);
Readln(so1);
TextColor(Green);
TextBackGround(White);
Write(`-Nhap so thu hai: `);
Readln(so2);
ClrScr;
TextColor(Magenta);
TextBackGround(Black);
GotoXY(31,10);
Writeln(`KET QUA TINH TOAN`);
GotoXY(25,12);
TextColor(Cyan);
TextBackGround(Black);
Writeln(`+Tong cua 2 so `,so1,` va `,so2,` = `,so1+so2);
GotoXY(25,13);
TextColor(Red);
TextBackGround(Black);
Writeln(`+Hieu cua 2 so `,so1,` va `,so2,` = `,so1-so2);
GotoXY(25,14);
TextColor(Yellow);
TextBackGround(Black);
Writeln(`+Tich cua 2 so `,so1,` va `,so2,` = `,so1*so2);
GotoXY(25,15);
TextColor(Green);
TextBackGround(Black);
Writeln(`+Thuong cua 2 so `,so1,` va `,so2,` = `,so1/so2:6:2);
GotoXY(26,22);
TextColor(Red);
TextBackGround(Black);
Writeln(`Bam phim
Readln;
ClrScr;
End.
Bài 2 :
Program Thu_tuc_tu_tao;
Uses Crt;
Procedure Ve(k:Integer; Kytu:Char);
Var
i:Integer;
Begin
For i:=1 To k Do
Write(kytu);
Writeln;
End;
Begin
ClrScr;
Textcolor(Yellow);
TextBackGround(Black);
Writeln(` THU TUC TU TAO`);
Writeln;
Textcolor(Red);
TextBackGround(Black);
Ve(50,`*`);
Textcolor(Green);
TextBackGround(Black);
Ve(50,`A`);
Textcolor(Cyan);
TextBackGround(Black);
Ve(50,`+`);
Textcolor(Magenta);
TextBackGround(Black);
Ve(50,`B`);
Textcolor(Cyan);
TextBackGround(Black);
Ve(50,`=`);
Textcolor(Green);
TextBackGround(Black);
Ve(50,`C`);
Textcolor(Red);
TextBackGround(Black);
Ve(50,`*`);
Writeln;
Textcolor(Blue);
TextBackGround(Black);
Writeln(` Bam phim
Readln
End.
Bài 3:
Program Ham_chuan;
Uses Crt;
Begin
ClrScr;
TextColor(Red);
TextBackGround(Black);
Writeln(`HE THONG CAC HAM CHUAN DA HOC`);
Writeln(`-----------------------------`);
TextColor(Yellow);
TextBackGround(Black);
Writeln(` +Cac ham ung dung voi so nguyen`);
Writeln(`-X=5,Ham Pred(X) = `,Pred(5)); {--> 4}
Writeln(`-X=5,Ham Succ(X) = `,Succ(5)); {--> 6}
Writeln(`-X=-5,Ham Abs(X) = `,Abs(5)); {--> 5}
Writeln(`-X=10,Ham Sqr(X) = `,Sqr(10)); {-->100}
Writeln(`-X=16,Ham Sqrt(X) = `,Sqrt(16):0:0); {-->4}
Writeln(`-X=3,Ham Odd(X) = `,Odd(3)); {-->True}
Writeln(`-X=3.1416,Ham Trunc(X) = `,Trunc(3.1416)); {-->3}
Writeln;
Writeln(` Bam phim
Readln;
TextColor(White);
TextBackGround(Black);
ClrScr;
TextColor(Cyan);
TextBackGround(Black);
Writeln(` +Cac ham ung dung voi so thuc`);
Writeln(`-X=3.1416,Ham Round(X) = `,Round(3.1416)); {-->3}
Writeln(`-Ham Pi co tri bang = `,pi); {-->3.1415926536E+00}
Writeln(`-X=3.1416,Ham Frac(X) = `,Frac(3.1416)); {-->1.14160000000E-01}
Writeln(`-X=3.1416,Ham Int(X) = `,Int(3.1416):0:0); {-->3}
TextColor(Magenta);
TextBackGround(Black);
Writeln(` +Cac ham ung dung voi kieu Boolean`);
Writeln(`-Ham Ord(false) = `,Ord(false)); {--> 0}
Writeln(`-Ham Ord(True) = `,Ord(true)); {--> 1}
Writeln(`-Ham Pred(True) = `,Pred(true)); {--> FALSE}
Writeln(`-Ham Pred(False) = `,Pred(False)); {--> TRUE}
Writeln(`-Ham Succ(False) = `,Succ(False)); {--> TRUE}
Writeln(`-Ham Succ(True) = `,Succ(True)); {--> FALSE}
Writeln;
Writeln(` Bam phim
Readln;
TextColor(White);
TextBackGround(Black);
ClrScr;
TextColor(LightBlue);
TextBackGround(Black);
Writeln(` +Cac ham va thu tuc ung dung voi kieu ky tu`);
Writeln(`-Ham Ord("A") = `,Ord(`A`)); {--> 65}
Writeln(`-Ham Chr(66) = `,Chr(66)); {--> `B`}
Writeln(`-Ham Chr(Ord("A") = `,Chr(Ord(`A`))); {--> `A`}
Writeln(`-Ham Pred("B") = `,Pred(`B`)); {--> `A`}
Writeln(`-Ham Succ("B") = `,Succ(`B`)); {--> `C`}
Writeln(`-Ham Upcase("a") = `,Upcase(`a`)); {--> `A`}
Writeln;
TextColor(Red);
TextBackGround(Black);
Writeln(` Bam phim
Readln
End.
Bài 4 :
Program Ham_tu_tao;
Uses Crt;
Var
n:Integer;
Function giaithua(M :Integer):LongInt;
Var
i,gt:Integer;
Begin
gt:=1;
For i:=1 To M Do
gt:=gt*i;
Writeln(`+Giai thua cua `,m,` la: `,gt);
End;
BEGIN
ClrScr;
TextColor(Red);
TextBackGround(Black);
Writeln(`HAM TINH GIAI THUA TU TAO`);
Writeln(`-------------------------`);
TextColor(Yellow);
TextBackGround(Black);
Write(`-Nhap so N = `);
Readln(n);
TextColor(Magenta);
TextBackGround(Black);
giaithua(n);
Writeln;
TextColor(Cyan);
TextBackGround(Black);
Writeln(` Bam phim
Readln
END.
Bài 1 :
Program Phep_tinh_so_hoc;
Var
x,y:Integer;
phep_tinh,tiep:Char;
(*---------------------*)
FUNCTION CONG(a,b:Integer):Integer;
Begin
cong:=a+b;
End;
(*---------------------*)
FUNCTION TRU(a,b:Integer):Integer;
Begin
tru:=a-b;
End;
(*---------------------*)
FUNCTION NHAN(a,b:Integer):Integer;
Begin
nhan:=a*b;
End;
(*---------------------*)
FUNCTION CHIA(a,b:Integer):Integer;
Begin
chia:=a DIV b;
End;
BEGIN
Repeat
Writeln(`CAC PHEP TOAN SO HOC`);
Writeln(`--------------------`);
Write(`-Nhap so thu nhat: `);
Readln(x);
Write(`-Nhap so thu hai : `);
Readln(y);
Write(`-Nhap phep tinh (+,-,*,/): `);
Readln(phep_tinh);
Case phep_tinh Of
`+` :Writeln(`+So `,X,` + `,Y,` = `,cong(x,y):5);
`-` :Writeln(`+So `,X,` - `,Y,` = `,tru(x,y):5);
`*` :Writeln(`+So `,X,` * `,Y,` = `,nhan(x,y):5);
`/` :Writeln(`+So `,X,` / `,Y,` = `,chia(x,y):5);
End;
Writeln;
Write(` Co thuc hien tiep khong (c/k) `);
Readln(tiep);
Until Upcase(tiep)=`K`;
END.
Bài 1 :
Program Uoc_so_chung;
Uses Crt;
Var
so1,so2,usc:Integer;
tiep:Char;
(*----------------*)
Procedure gioi_thieu;
Begin
ClrScr;
TextColor(Red);
TextBackGround(Black);
Writeln(`**************************************`);
Writeln(`* MINH HOA CHUONG TRINH CON *`);
Writeln(`* Su khac nhau giua Thu tuc va Ham *`);
Writeln(`* Tim uoc so chung lon nhat cua 2 so *`);
Writeln(`* Ngay viet chuong trinh 24-3-1999 *`);
Writeln(`**************************************`);
Writeln;
End;
(*----------------*)
Procedure Nhap_so;
Var
sua:Char;
Begin
TextColor(Yellow);
TextBackGround(Black);
Repeat
Write(`-Nhap so thu nhat: `);
Readln(so1);
Write(`-Nhap so thu hai : `);
Readln(so2);
TextColor(Cyan);
TextBackGround(Black);
Write(`-Co can sua khong (c/k) ? `);
Readln(sua);
Until Upcase(sua) =`K`;
Writeln;
End;
(*----------------*)
Function uoc_so(x,y:Integer):Integer;
Begin
Repeat
If x > y Then
x:=x-y
Else
y:=y-x;
Until x=y;
usc:=x;
End;
(*----------------*)
Procedure Xuat;
Begin
TextColor(Magenta);
TextBackGround(Black);
Writeln(`+Uoc so chung lon nhat cua`);
Writeln(` So `,so1,` va `,so2,` la: `,usc);
Writeln;
End;
(*----------------*)
BEGIN
Repeat
Gioi_thieu;
Nhap_so;
uoc_so(so1,so2);
Xuat;
TextColor(Green);
TextBackGround(Black);
Write(`-Co thuc hien tiep nua khong (c/k)? `);
Readln(tiep);
Until (tiep = `k`) Or (tiep = `K`);
END.
Bài 1 :
Program Su_dung_ham;
Var
so1,so2,so3,tong:Integer;
(*-----------------------*)
Function tam_thua(x:Integer):LongInt;
Begin
tam_thua:=x*x*x;
End;
BEGIN
Writeln(`CHUONG TRINH CON LA HAM`);
Writeln(`-----------------------`);
Write(`-Nhap so thu nhat: `);
Readln(so1);
Write(`-Nhap so thu hai : `);
Readln(so2);
Write(`-Nhap so thu ba : `);
Readln(so3);
Writeln(`+Tam thua cua so thu nhat (`,so1,`) la: `,tam_thua(so1));
Writeln(`+Tam thua cua so thu hai (`,so2,`) la: `,tam_thua(so2));
tong:=tam_thua(so1) + tam_thua(so2);
Writeln(`+Tong tam thua cua 2 so: `,tong);
If tam_thua(so1) > so3 Then
Writeln(`Tam thua cua so 1 lon hon so `,so3)
Else
Writeln(`+Tam thua cua so 1 nho hon so `,so3);
Readln
END.
Bài 1 :
Program Su_dung_thu_tuc;
Var
so1,so2,so3,tong,y1,y2:Integer;
(*-----------------------*)
Procedure tam_thua(x:Integer;Var y:Integer);
Begin
y:=x*x*x;
End;
BEGIN
Writeln(`CHUONG TRINH CON LA THU TUC`);
Writeln(`---------------------------`);
Write(`-Nhap so thu nhat: `);
Readln(so1);
Write(`-Nhap so thu hai : `);
Readln(so2);
Write(`-Nhap so thu ba : `);
Readln(so3);
tam_thua(so1,y1);
tam_thua(so2,y2);
Writeln(`+Tam thua cua so thu nhat (`,so1,`) la: `,y1);
Writeln(`+Tam thua cua so thu hai (`,so2,`) la: `,y2);
tam_thua(so1,y1);
tam_thua(so2,y2);
tong:=y1+y2;
Writeln(`+Tong tam thua cua 2 so: `,tong);
If y1 > so3 Then
Writeln(`Tam thua cua so 1 lon hon so `,so3)
Else
Writeln(`+Tam thua cua so 1 nho hon so `,so3);
Readln
END.
Bài 1 :
Program Thu_tuc_long_nhau;
Uses Crt;
Var
t:Byte;
tiep:Char;
(*--------------------------------*)
Procedure Giai_tri(x:Integer);
Procedure giai_tri1;
Begin
TextColor(Green);
TextBackGround(Black);
Writeln(`Troi lanh,nen o nha coi TV`);
End;
(*----------------*)
Procedure giai_tri2;
Begin
TextColor(Cyan);
TextBackGround(Black);
Writeln(`Troi mat me,nen di cam trai`);
End;
(*----------------*)
Procedure g
* Một số tài liệu cũ có thể bị lỗi font khi hiển thị do dùng bộ mã không phải Unikey ...
Người chia sẻ: Nguyễn Văn Hoán
Dung lượng: |
Lượt tài: 0
Loại file:
Nguồn : Chưa rõ
(Tài liệu chưa được thẩm định)