Hay hay
Chia sẻ bởi Hồ Văn Duẫn |
Ngày 16/10/2018 |
35
Chia sẻ tài liệu: hay hay thuộc Tin học 9
Nội dung tài liệu:
Phep tru so hoc
Program Phep_Tru;
Var
so1,so2,hieu :Integer;
Begin
Writeln(` CHUONG TRINH THUC HIEN PHEP TRU SO HOC`);
Writeln(` co toi da 4 ky so`);
Write(`-Nhap so thu nhat = `);
Readln(so1);
Write(`-Nhap so thu hai = `);
Readln(so2);
hieu:= so1-so2;
Writeln;
Writeln;
Writeln(`-------------------------------`);
Writeln;
Writeln(` `,so1:4);
Writeln(` - `,so2:4);
Writeln(` -----`);
Writeln(` = `,hieu:5);
Readln
End.
Bang cuu chuong
Program Cuu_chuong_1;
Var
so :Integer;
Begin
Write(`-Bang cuu chuong so may ?: `);
Readln(so);
Writeln;
Writeln;
Writeln(` CHUONG TRINH BANG CUU CHUONG`);
Writeln(`-------------------------------`);
Writeln;
Writeln(so:2,` lan 1 = `,so*1:3);
Writeln(so:2,` lan 2 = `,so*2:3);
Writeln(so:2,` lan 3 = `,so*3:3);
Writeln(so:2,` lan 4 = `,so*4:3);
Writeln(so:2,` lan 5 = `,so*5:3);
Writeln(so:2,` lan 6 = `,so*6:3);
Writeln(so:2,` lan 7 = `,so*7:3);
Writeln(so:2,` lan 8 = `,so*8:3);
Writeln(so:2,` lan 9 = `,so*9:3);
Writeln(so:2,` lan 10 = `,so*10:3);
Readln
End.
Tinh Z qua so thuc X
Program Tinh_Z;
Var
x,z:Real;
Begin
Writeln(`TINH GIA TRI Z QUA SO THUC X`);
Writeln(`----------------------------`);
Write(`-Nhap tri x = `);
Readln(x);
z:=ln(x + abs(sin(2 * x)));
Writeln(`*Gia tri cua Z = `,z:10:2);
Writeln(` Bam phim de ket thuc`);
Readln
End.
Doi he thap phan ran hi phan
Program Doi_thap_phan_ra_nhi_phan;
Var
He10,N,Y:Word;
He2,Tam:String;
Begin
Writeln(`DOI SO TU HE THAP PHAN SANG HE NHI PHAN`);
Writeln(` -----------------`);
Writeln;
Write(`-Nhap so nguyen he thap phan: `);
Readln(He10);
N:=He10;
He2:=` `;
Repeat
Y:=He10 Mod 2;
Str(Y, Tam);
He2:=Tam + He2;
He10:= He10 Div 2;
Until He10 = 0;
Writeln;
Writeln(`+So he 10 la : `,N);
Writeln(`+Doi sang he 2 la: `,He2);
Writeln;
Writeln(` Bam phim de ket thuc`);
Readln
End.
Program Phep_Tru;
Var
so1,so2,hieu :Integer;
Begin
Writeln(` CHUONG TRINH THUC HIEN PHEP TRU SO HOC`);
Writeln(` co toi da 4 ky so`);
Write(`-Nhap so thu nhat = `);
Readln(so1);
Write(`-Nhap so thu hai = `);
Readln(so2);
hieu:= so1-so2;
Writeln;
Writeln;
Writeln(`-------------------------------`);
Writeln;
Writeln(` `,so1:4);
Writeln(` - `,so2:4);
Writeln(` -----`);
Writeln(` = `,hieu:5);
Readln
End.
Bang cuu chuong
Program Cuu_chuong_1;
Var
so :Integer;
Begin
Write(`-Bang cuu chuong so may ?: `);
Readln(so);
Writeln;
Writeln;
Writeln(` CHUONG TRINH BANG CUU CHUONG`);
Writeln(`-------------------------------`);
Writeln;
Writeln(so:2,` lan 1 = `,so*1:3);
Writeln(so:2,` lan 2 = `,so*2:3);
Writeln(so:2,` lan 3 = `,so*3:3);
Writeln(so:2,` lan 4 = `,so*4:3);
Writeln(so:2,` lan 5 = `,so*5:3);
Writeln(so:2,` lan 6 = `,so*6:3);
Writeln(so:2,` lan 7 = `,so*7:3);
Writeln(so:2,` lan 8 = `,so*8:3);
Writeln(so:2,` lan 9 = `,so*9:3);
Writeln(so:2,` lan 10 = `,so*10:3);
Readln
End.
Tinh Z qua so thuc X
Program Tinh_Z;
Var
x,z:Real;
Begin
Writeln(`TINH GIA TRI Z QUA SO THUC X`);
Writeln(`----------------------------`);
Write(`-Nhap tri x = `);
Readln(x);
z:=ln(x + abs(sin(2 * x)));
Writeln(`*Gia tri cua Z = `,z:10:2);
Writeln(` Bam phim
Readln
End.
Doi he thap phan ran hi phan
Program Doi_thap_phan_ra_nhi_phan;
Var
He10,N,Y:Word;
He2,Tam:String;
Begin
Writeln(`DOI SO TU HE THAP PHAN SANG HE NHI PHAN`);
Writeln(` -----------------`);
Writeln;
Write(`-Nhap so nguyen he thap phan: `);
Readln(He10);
N:=He10;
He2:=` `;
Repeat
Y:=He10 Mod 2;
Str(Y, Tam);
He2:=Tam + He2;
He10:= He10 Div 2;
Until He10 = 0;
Writeln;
Writeln(`+So he 10 la : `,N);
Writeln(`+Doi sang he 2 la: `,He2);
Writeln;
Writeln(` Bam phim
Readln
End.
* 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ẻ: Hồ Văn Duẫn
Dung lượng: 26,00KB|
Lượt tài: 0
Loại file: doc
Nguồn : Chưa rõ
(Tài liệu chưa được thẩm định)