Info
. Giải PT bậc 1 (ax+b=0)VAR A,B:REAL; BEGIN WRITELN(`NHAP A, B: `); READLN(A,B); IF (A=0) AND (B0) THEN WRITELN(`X THUO^.C R`); IF A0 THEN WRITELN(`NGHIEM: X>`,-B/A:0:2); READLN; END. ĐỔI SỐ THÀNH CHỮ (VD: A --> TWO) VAR N:BYTE; BEGIN WRITELN(`NHAP N: `); READLN(N); IF N=1 THEN WRITE(`1 = ONE`); IF N=2 THEN WRITE(`2 = TWO`); IF N=3 THEN WRITE(`3 = THREE`); IF N=4 THEN WRITE(`4 = FOUR`); IF N=5 THEN WRITE(`5 = FIVE`); READLN; END. Bài 3: Giải hệ phương trình bậc 1 - 2 ẩn sốVAR A1, B1, C1, A2, B2, C2:INTEGER; DX, DY ,DD : REAL; BEGIN WRITELN(`NHAP HE SO A1, B1, C1: `); READLN(A1, B1, C1); WRITELN(`NHAP HE SO A2, B2, C2: `); READLN(A2, B2, C2); DD := A1*B2-A2*B1; DX := C1*B2-C2*B1; DY := A1*C2-A2*C1; IF DD = 0 THEN IF (DX=0) AND (DY=0 ) THEN WRITE(`HPT VSN`) ELSE WRITE(`HPT VN`) ELSE BEGIN WRITELN(`HPT CO NGHIEM: `); WRITELN(`X = `, DX/DD:2:2); WRITELN(`Y = `, DY/DD:2:2); END; READLN; END. Nhập tọa độ 3 điểm và xét tan giác VAR XA, YA, XB, YB, XC, YC, AB, BC, AC, S, P: REAL; BEGIN WRITELN(`NHAP TOA DO DIEM A(XA,YA): `); READLN(XA,YA); WRITELN(`NHAP TOA DO DIEM B(XB,YB): `); READLN(XB,YB); WRITELN(`NHAP TOA DO DIEM C(XC,YC): `); READLN(XC,YC); AB:=SQRT(SQR(XB-XA)+SQR(YB-YA)); BC:=SQRT(SQR(XC-XB)+SQR(YC-YB)); AC:=SQRT(SQR(XC-XA)+SQR(YC-YA)); IF (AB=0) OR (BC=0) OR (AC=0) OR (AB+AC=BC) OR (AB+BC=AC) OR (AC+BC=AB) THEN WRITELN(`KHONG PHAI LA 3 DINH CUA TAM GIAC`) ELSE BEGIN WRITELN(`LA 3 DINH CUA TAM GIAC`); IF (AB=BC) AND (AB=AC) THEN WRITELN(`LA TAM GIAC DEU`); IF (AB=BC) OR (AB=AC) OR (BC=AC) THEN WRITELN(`LA TAM GIAC CAN`); IF (SQR(AB)+SQR(AC)=SQR(BC)) OR (SQR(AB)+SQR(BC)=SQR(AC)) OR (SQR(BC)+SQR(AC)=SQR(AB)) THEN WRITELN(`LA TAM GIAC VUONG`); P:=(AB+AC+BC)/2; S:=SQRT(P*(P-AB)*(P-AC)*(P-BC)); WRITELN(`DIEN TICH CUA TAM GIAC LA:`,S:0:2); END; READLN; END. Bài toán Gà – Chó VAR G,C:REAL; BEGIN X+Y=36; 2X+4Y=100; G:=0; C:=0; WHILE G...