Demo entry 6761490

123qwe123

   

Submitted by anonymous on Sep 28, 2018 at 00:10
Language: C++. Code size: 276 Bytes.

#include<iostream>
using namespace std;

int fibonacciB(int n){
    int a = 0, b = 1, c;
    for(int i=0; i < n; i++){
        c = a + b;
        a = b;
        b = c ;}
    return a;
}
int main(){
    int x;
    cin >> x;
    cout << fibonacciB(x) << endl;
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).