21. 21
息2004,HONGMINHSN
Ch動董ng 1: M畛 畉u
L畉p tr狸nh c坦 c畉u tr炭c: V鱈 d畛 t鱈nh giai th畛a (PASCAL)
FUNCTION Factorial(n: INTEGER) : INTEGER
VAR X: INTERGER;
BEGIN
X := n;
WHILE (n > 1) DO
BEGIN
DEC(n);
X := X * n;
END
Factorial := X;
END
END;
22. 22
息2004,HONGMINHSN
Ch動董ng 1: M畛 畉u
L畉p tr狸nh c坦 c畉u tr炭c: V鱈 d畛 qu畉n l箪 sinh vi棚n
struct Date { int Day, Month, Year; };
struct Student
{
string name;
Date dob;
int code;
};
typedef Student* Students; // c畉u tr炭c m畉ng
Students create(int max_items, int item_size );
void destroy(Students lop);
void add(Students lop, Student sv);
void delete(Students lop, Student sv);
Student find(Students lop, int code);