Pascal: var ar:array[1..13] of integer; a:integer; begin ar[1]:=0; ar[2]:=1; ar[3]:=1; for a:=4 to 13 do ar[a]:=ar[a-1]+ar[a-2]; for a:=1 to 13 do write(ar[a],','); readln; end.
C++: #include <iostream> #include <cstdlib> // для system using namespace std;
int main() { int ar[12]; ar[1]=0; ar[2]=1; ar[3]=1; for (int a=4;a<11;a++) { ar[a]=ar[a-1]+ar[a-2]; } for (int b;b<11;b++) { cout << ar[b] << ","; } system("pause"); }
var ar:array[1..13] of integer;
a:integer;
begin
ar[1]:=0;
ar[2]:=1;
ar[3]:=1;
for a:=4 to 13 do
ar[a]:=ar[a-1]+ar[a-2];
for a:=1 to 13 do
write(ar[a],',');
readln;
end.
C++:
#include <iostream>
#include <cstdlib> // для system
using namespace std;
int main()
{
int ar[12];
ar[1]=0;
ar[2]=1;
ar[3]=1;
for (int a=4;a<11;a++)
{
ar[a]=ar[a-1]+ar[a-2];
}
for (int b;b<11;b++)
{
cout << ar[b] << ",";
}
system("pause");
}