九度Online Judge

OJ新增积分机制,如有任何问题或者建议,请发帖到九度论坛OJ意见反馈版,祝大家一切顺利!
亲,九度OJ官方微博开通了,欢迎你来粉!微博地址:weibo.com/jobdu

 题目1092-九度Online Judge,用代码记录你的成长之路!

题目1092:Fibonacci

时间限制:1 秒

内存限制:32 兆

特殊判题:

提交:2519

解决:1810

题目描述:

    The Fibonacci Numbers{0,1,1,2,3,5,8,13,21,34,55...} are defined by the recurrence:
    F0=0 F1=1 Fn=Fn-1+Fn-2,n>=2
    Write a program to calculate the Fibonacci Numbers.

输入:

    Each case contains a number n and you are expected to calculate Fn.(0<=n<=30) 。

输出:

   For each case, print a number Fn on a separate line,which means the nth Fibonacci Number.

样例输入:
1
样例输出:
1
来源:
2006年上海交通大学计算机研究生机试真题
答疑:
解题遇到问题?分享解题心得?讨论本题请访问:http://t.jobdu.com/thread-7815-1-1.html