# 斐波那數列 ``` #include <iostream> #include <cstring> #include <fstream> #include <cstdio> #include <stdlib.h> using namespace std; int fib(int n) { if(n==1 | n==2) return 1; else return (fib(n-1)+fib(n-2)); } int main() { printf("%d\n",fib(10)); return 0; } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up