fibonacci数
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream> using namespace std; int main(){ int f; cin>>f; int a[f]; a[0]=0; a[1]=1; for(int i=0;i+2<f;i++){ a[i+2]=a[i+1]+a[i]; cout<<a[i+2]<<endl; } }
Username or Email Address
Password
Remember Me
Username
Email
Registration confirmation will be emailed to you.