1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <fstream>
#include <cstdio>
#include <math.h>

using namespace std;
int main()
{
	int n=100;
	int i, fib1, fib2, pomoc;
	int tab[n];
	fib1 = 1;
	fib2 = 1;

	for (i = 0; i < n; i++)
	{
		pomoc = fib1 + fib2;
		fib1 = fib2;
		fib2 = pomoc;
		cout << fib2 << " ";
	}	
	int z,r;
	ifstream inFile;
	inFile.open("napisy.txt");
	inFile>>z;
	r=z%100;
	bool p=true;
	for(int i=0;tab[i]<n;i++)
	{
		if(tab[i]%100==r)
		{
			cout<<endl<<tab[i];
			p=true;
		}
	}
	if(p==false)
	cout<<"NIE";
	
	getchar();
	return 0;
}