【题目描述】
【输入】
【输出】
【输入样例】
【输出样例】
#include<iostream> using namespace std; int main(){ int d=0,s=1,b=1,n;//第2月份记录结果 //大上个月,上个月,本月,下面自3月起推 cin>>n; for(int i=3;i<=n;++i){ d=s; s=b; b=d+s; } if(n<3)cout<<1; else cout<<b; return 0; }//OK
Powered by 孙会中 @ 2024-2026【 www.sunhuizhong.cn 】All rights reserved
访问统计:386183 本月:281 上月:799 今日:7 昨日:6 当前在线:1人