Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: fillhavertz

Problemset: อนุกรม

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-07 00:59:58

#include <iostream>
using namespace std;

int main()
{   
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    cin>>n;
    long a=0,b=1,c;
    if(!n) cout<<0;
    for(int i =2;i<=n;i++){
        c = a+b;
        a=b;
        b = c;
    }cout<<c;
    return 0;
    
    
    
    
}