Pagini recente » Cod sursa (job #1974430) | Cod sursa (job #2270542) | Cod sursa (job #584033) | Cod sursa (job #2667146) | Cod sursa (job #712799)
Cod sursa(job #712799)
//Include
#include <fstream>
using namespace std;
//Constante
const int modulo = 666013;
//Variabile
ifstream in("kfib.in");
ofstream out("kfib.out");
int n;
int curent, precedent = 1, anteprecedent;
//Main
int main()
{
in >> n;
while(n-- % 1332028)
{
curent = (precedent + anteprecedent) % modulo;
anteprecedent = precedent;
precedent = curent;
}
out << anteprecedent;
in.close();
out.close();
return 0;
}