#include <bits/stdc++.h> using namespace std; long long fun(int k) { long long a=1,b=1,c=0; if(k==1 || k==2) return 1; for(int i=3; i<=k; i++){ c=a+b; b=a; a=c; } return a; } int main() { int k=0; cin>>k; printf("%d\n",fun(k)); return 0; }
By signing up a 羽润编程 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 羽润编程 universal account