Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
222 B
1
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
	int n,a,b,c;
	cin >> n;
	a = 0;
	b = 1;
	for (int i = 0; i < n-1; i++)
	{
		c = a;
		a = b;
		b += c;
	}
	cout << b;
	if (n==0)
	{
		cout << 0;
	}
}