Codeforces Round #382 (Div. 2), problem: (C) Tennis Championship Solution in C/C++

#include<stdio.h>
main()
{
	long long int n,i,j,c=0,a,b,k;
	scanf("%I64d",&n);
	a=1;
	b=1;
	k=a+b;
	while(k<=n)
	{   c++;
	    a=b;
	  	b=k;
	  k=a+b;	
	}
	printf("%I64d",c);
}

Leave a Reply

Your email address will not be published. Required fields are marked *