Submission

Status:

PPPPP-----

Subtask/Task Score:

50/100

Score: 50

User: fillhavertz

Problemset: อนุกรม

Language: cpp

Time: 0.003 second

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

#include <iostream>
using namespace std;

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