Cod sursa(job #781304)

Utilizator andreeainfo_dAndreea Dutulescu andreeainfo_d Data 24 august 2012 09:34:20
Problema Al k-lea termen Fibonacci Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.27 kb
using namespace std;
#include<stdio.h>
int a,b,c,k,i;
int main()
{
	freopen("kfib.in","r",stdin);
	freopen("kfib.out","w",stdout);
	scanf("%d",&k);
	a=0;
	b=1;
	for(i=2;i<=k-1;i++)
	{
		c=a+b;
		c=c%666013;
		a=b;
		b=c;
	}
	printf("%d\n",c);
	return 0;
}