3 条题解
-
2Qez@石湖中学 (秦恩泽) LV 8 @ 2021-01-17 13:44:37
#include <iostream>
using namespace std;
int main()
{
int n,c,a,b,i;
cin>>n;
a=1;
b=1;
i=3;
cout<<a<<" "<<b;while(i<=n)
{c=a+b;
a=b;
b=c;
cout<<" "<<c;
i=i+1;
}
return 0;}
-
02021-01-25 16:02:49@
#include <iostream>
using namespace std;
int main()
{
int w=1,ww,a=1,b=1,c;
cin>>ww;if(ww<3)
if(ww!=1)
cout<<"1 1";
else
cout<<"1";
else
{
cout<<a<<" "<<b<<" ";
while(w<=ww-2)
{
c=a;
a=b;
b=c+a;
cout<<b<<" ";
w=w+1;}
}
return 0;}
-
-22021-01-17 08:27:53@
#include <iostream>
using namespace std;
int main()
{
int n,c,a,b,i;
cin>>n;
a=1;
b=1;
i=3;
cout<<a<<" "<<b;
while(i<=n)
{
c=a+b;
a=b;
b=c;
cout<<" "<<c;
i=i+1;
}
return 0;}
- 1
信息
- 难度
- 7
- 分类
- (无)
- 标签
- 递交数
- 3614
- 已通过
- 742
- 通过率
- 21%
- 被复制
- 8
- 上传者