delete pics to save space
This commit is contained in:
20
history_source/信息学奥赛一本通/2.3.6.cpp
Normal file
20
history_source/信息学奥赛一本通/2.3.6.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include<cstdio>
|
||||
int main()
|
||||
{
|
||||
int n;
|
||||
scanf("%d",&n);
|
||||
if(n<=2){
|
||||
printf("%d\n",n);
|
||||
return 0;
|
||||
}
|
||||
int a=1,b=2,c;
|
||||
for(int i=3;i<=n;i++)
|
||||
{
|
||||
c=a+b;
|
||||
a=b;
|
||||
b=c;
|
||||
}
|
||||
printf("%d\n",c);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user