Cod sursa(job #781301)

Utilizator andreeainfo_dAndreea Dutulescu andreeainfo_d Data 24 august 2012 09:29:24
Problema Al k-lea termen Fibonacci Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.26 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;i++)
	{
		c=a+b;
		c=c%666013;
		b=c;
		a=b;
	}
	printf("%d",c);
	return 0;
}