Cod sursa(job #1609355)
| Utilizator | Data | 22 februarie 2016 19:13:16 | |
|---|---|---|---|
| Problema | Al k-lea termen Fibonacci | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.22 kb |
#include<fstream>
using namespace std;
ifstream in("kfib.in");
ofstream out("kfib.out");
int x,y=1,z,k;
int main() {
in>>k;
while(k--%1332028) {
z=(x+y)%666013;
x=y;y=z;}
out<<x<<"\n";
}
