Submission

Status:

PPPPP-----

Subtask/Task Score:

50/100

Score: 50

User: kkxkkx001

Problemset: อนุกรม

Language: cpp

Time: 0.004 second

Submitted On: 2026-09-30 14:30:57

#include <iostream>
using namespace std;

int main(){
	int n,one,two;
	one,two = 1,1;
	cin >> n;
	if(n<=100 and n != 1 and n!= 2){
		for (int i=1; i<n;i++){
			int temp = one + two;
			one = two;
			two = temp;
		}
		cout << two;	
	}
	if (n==1 or n==2){
		cout << 1;
	}
}