[Pascal – TUT] Posts 4: Enumeration, the passage, collective
This article we will learn about the types listed, the passage, collective
[qads]
1. Kiểu liệt kê
a. Khai báo
Cách 1: Khai báo gián tiếp
- Cú pháp:
type <tên kiểu>=(hằng 1, hằng 2,..., hằng n);
var <tên biến>:<tên kiểu>;
Cách 2: Khai báo trực tiếp
- Cú pháp:
var <tên biến>:(hằng 1, hằng 2,..., hằng n);
b. Một số hàm áp dụng cho kiểu liệt kê
c. Nhập xuất kiểu liệt kê
2. Kiểu đoạn con
a. Khai báo
Cách 1: Khai báo gián tiếp
- Cú pháp:
type <tên kiểu>=<giá trị đầu>..<giá trị cuối>;
var <tên biến>:<tên kiểu>;
Cách 2: Khai báo trực tiếp
- Cú pháp:
var <tên biến>:<giá trị đầu>..<giá trị cuối>;
b. Tác dụng và cách sử dụng
3. Kiểu tập hợp
a. Khai báo
Cách 1: Khai báo gián tiếp
- Cú pháp:
type <tên kiểu>= set of <kiểu thứ tự>;
var <tên biến>:<tên kiểu>;
Cách 2: Khai báo trực tiếp
- Cú pháp:
var <tên biến>:set of <kiểu thứ tự>;
b. Mô tả tập hợp
Một tập hợp được mô tả bằng cách liệt kê các phần tử của tập
hợp, chúng cách nhau dấu , (phẩy) và được đặt trong cặp dấu []
(ngoặc vuông). Các phần tử có thể là hằng, biến, biểu thức.
c. Các phép toán trên tập hợp
- Phép hợp
- Phép giao
- Phép trừ
- Phép thử
- Các phép so sánh (=, <>, >=,<=).
Original article: vietsource.net



My stomach a, New e DC no longer groping pascal DC should not familiar enough, e do, please just e write the program as stars nha:
create a program to filter the integer part and the decimal fraction gave, including requirements:
+enter the number of the filters
+specify the material and the angle of the part decimal classification( CEO: 3,5 former somewhat 3 decimal is somewhat 0,5)
I thank the previous evening sir ^^
where n,in:real;
b,c:array[1..1000]of integer;
the:array[1..1000]of real;
start
clrscr;
write(‘ Enter the element = ');readln(n);
for i:=1 to n do
start
read(the[in]);
b[in]:=int(the[in]);
c[in]:=frac(the[in]);
than;
writeln;
for i:=1 to n do writeln(‘ The integer part of ',the[in],’ the : ',b[in],’ . Phan decimal : ',c[in] );
readln;
than;
The illustrated lecture videos on Youtube does not see, add review helps nhé.
Thank you. I will review.