Cod sursa(job #3328802)

Utilizator tudorsigmatudorsigma tudorsigma Data 10 decembrie 2025 15:14:23
Problema Nunta Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.88 kb
/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <bits/stdc++.h>
using namespace std;

long long fibo(int n) {
    if (n==1)
    return 1;
    
    if (n==2) 
    return 2;
    else {
        long long a=1, b=2,c=0;
        
        for (int i=3;i<=n;i++ ) {
            c=a+b; 
            a=b;
            b=c;
            
        }
        return c;
    }
   
}


int main()
{
    int n;
    ifstream f("nunta.in");
    ofstream g("nunta.out");
    f>>n;
    long long nr=fibo(n);

    return 0;
}