提交时间:2023-08-14 07:08:25
运行 ID: 24596
#include<iostream> using namespace std; int main() { int sum,n1,n2,k; n1=1; n2=1; cin>>k; for(int i=3;i<=k;i++) { sum=n1+n2; n2=n1; n1=sum; } cout<<sum; return 0; }