//xem co phai tam giac khong
Var
a , b , c : Real ;
BEGIN
Writeln (` Nhap do dai 3 canh cua tam giac : `) ;
Write (` a = `) ; Readln ( a ) ;
Write (` b = `) ; Readln ( b ) ;
Write (` c = `) ; Readln ( c ) ;
If ( a + b > c ) and ( b + c > a ) and ( c + a > b )
and ( a > 0 ) and ( b > 0 ) and ( c > 0 ) Then
Writeln (` Thoa man : Day la 3 canh cua mot tam giac `)
Else
Writeln (` Khong thoa man ! `) ;
Readln ;
END .
//xem co phai tam giac khong Var a , b , c : Real ; BEGIN Writeln (` Nhap do dai 3 canh cua tam giac : `) ; Write (` a = `) ; Readln ( a ) ; Write (` b = `) ; Readln ( b ) ; Write (` c = `) ; Readln ( c ) ; If ( a + b > c ) and ( b + c > a ) and ( c + a > b ) and ( a > 0 ) and ( b > 0 ) and ( c > 0 ) Then Writeln (` Thoa man : Day la 3 canh cua mot tam giac `) Else Writeln (` Khong thoa man ! `) ; Readln ; END . .. //nhap vao 4 so tim max Var Max , a , b , c , d : Real ; BEGIN Writeln (` Nhap gia tri cua 4 so : `) ; Write (` a = `) ; Readln ( a ) ; Write (` b = `) ; Readln ( b ) ; Write (` c = `) ; Readln ( c ) ; Write (` d = `) ; Readln ( d ) ; Max := a ; If Max < b Then Max := b ; If Max < c Then Max := c ; If Max < d Then Max := d ; Writeln (` Gia tri lon nhat la : `, Max ) ; Readln ; END . // tim ngay, thang, nam Var Thu , Ngay , Thang : Byte ; Nam : Integer ; BEGIN Write (` Doc Ngay Thang Nam : `) ; Readln ( Ngay , Thang , Nam ) ; Nam := 1900 + ( Nam mod 1900 ) ; If Thang < 3 Then Begin Thang := Thang + 12 ; Nam := Nam - 1 ; End ; Thu := Abs ( Ngay + Thang * 2 + ( Thang + 1 ) * 3 div 5 + Nam + Nam div 4 ) mod 7 ; Case Thu Of 0 : Writeln (` Chu Nhat `) ; 1 : Writeln (` Thu Hai `) ; 2 : Writeln (` Thu Ba `) ; 3 : Writeln (` Thu Tu `) ; 4 : Writeln (` Thu Nam `) ; 5 : Writeln (` Thu Sau `) ; 6 : Writeln (` Thu Bay `) ; End ; Readln ; END . // phieu diem Uses Crt ; Var SBD : Integer; Van , Toan , Ngoaingu , Tongdiem : Real ; BEGIN Clrscr ; Write (` So bao danh : `) ; Readln( SBD ) ; Write (` Diem toan : `) ; Readln( Toan ) ; Write (` Diem ngoai ngu : `) ; Readln( Ngoaingu ) ; Write (` Diem van : `) ; Readln ( Van ) ; Tongdiem := Toan + Van + Ngoaingu ; Clrscr ; Writeln (` Phieu Bao Diem `) ; Writeln (` So bao danh : `, SBD ) ; Writeln (` Diem van : `, Van ) ; Writeln (` Diem toan : `, Toan ) ; Writeln (` Diem ngoai ngu : `, Ngoaingu) ; Writeln (` Tong diem : `, Tongdiem) ; If Tongdiem >= 15 Then Writeln(` Ban da trung tuyen `) Else Writeln(` Ban khong trung tuyen `) ; Readln ; END . //Cong tru nhan chia Uses Crt ; Var a , b , T : Real ; Pt : Char ; BEGIN Clrscr ; Write (` a = `) ; Readln( a ) ; Write (` b = `) ; Readln( b ) ; Write (` Phep tinh thuc hien la (+ - * /) : `) ; Readln( Pt ) ; If Pt = `+’ Then T := a + b ; If Pt = `-’ Then T := a - b ; If Pt = `*’ Then T := a * b ; If Pt = `/’ Then T := a / b ; Write ( a , pt , b , ` = `, T ) ; Readln ; END . //giai pt Uses Crt;
Tài liệu đính kèm: