Submission
Status:
PPPPP-----
Subtask/Task Score:
50/100
Score: 50
User: korn234
Problemset: อนุกรม
Language: cpp
Time: 0.003 second
Submitted On: 2026-09-19 13:06:54
#include <iostream>
using namespace std;
int main() {
int n, a=1, b=1, c;
cin>>n;
if (n==1 || n==2){
cout<<1;
return 0;
}
for (int i=3; i<=n; i++){
c=a+b;
a=b;
b=c;
}
cout<<b;
}