Submission

Status:

PPPPP-----

Subtask/Task Score:

50/100

Score: 50

User: speed_coding

Problemset: อนุกรม

Language: cpp

Time: 0.003 second

Submitted On: 2026-09-29 19:07:53

#include<bits/stdc++.h>
using namespace std;
int main(){
		int n;
		cin >> n;
		if (n <= 2){
			cout << 1 << "\n";
			return 0;
        }
		int a = 1; 
        int b = 1; 
        int c =0;
		for(int i = 3; i<= n; ++i){
			c = a + b;
			a = b;
			b = c;
		}
		cout << b << "\n" ;
	return 0;
}