Professional Documents
Culture Documents
Pascal
Pascal
ProgramdÊuBai03;; Comment
(****************************************)
Comment
(* Chuong Comment
trinh in ca phan tu lon hon *)
For i := 1 To N Do
Begin
Write('Cho A[', i, '] : ');
ReadLn(A[i]);
End;
ReadLn;
End.
ThiÕu dÊu ;
Program Bai01;
(*********************************)
(* Chuong trinh tinh day N so *)
Open (* Fibonacci *)
(*********************************)
Var
Compile F: Array[1..20] OF Integer;
N, i: Integer;
Begin
Write('Cho so N (<= 20): ');
ReadLn(N);
For i := 1 To N Do
If i < 3 Then
F[i] := 1
Else
F[i] := F[i-1] + F[i-2];
(* In ket qua *)
For i := 1 To N Do
WriteLn(i:4, F[i]:6);
ReadLn;
End.