NYOJ-Fibonacii数
来源:互联网 发布:周星驰 电视剧 知乎 编辑:程序博客网 时间:2024/05/01 22:56
#include <stdio.h>
int main (){
int a,b[40],c,d;
scanf("%d",&a);
while (a>0){
scanf ("%d",&c);
b[0]=1;
b[1]=1;
if (c>2){
for (d=2;d<c;d++){
b[d]=b[d-1]+b[d-2];
}
printf("%d\n",b[c-1]);
}
else
printf("%d\n",b[c-1]);
a--;
}
return 0;
}
int main (){
int a,b[40],c,d;
scanf("%d",&a);
while (a>0){
scanf ("%d",&c);
b[0]=1;
b[1]=1;
if (c>2){
for (d=2;d<c;d++){
b[d]=b[d-1]+b[d-2];
}
printf("%d\n",b[c-1]);
}
else
printf("%d\n",b[c-1]);
a--;
}
return 0;
}
0 0
- NYOJ-Fibonacii数
- Fibonacii数列
- poj 3070 Fibonacii(矩阵乘法求Fibonacii)
- Fibonacci + 数论 + fibonacii公式
- Fibonacii (HDU 1568)
- python--Fibonacii序列
- NYOJ - 奇偶数分离
- NYOJ - 水仙花数
- NYOJ - 有趣的数
- NYOJ - 蛇形填数
- NYOJ - 数的长度
- NYOJ - 数乌龟
- NYOJ - 组合数
- NYOJ 13 Fibonacci数
- 组合数 nyoj
- 蛇形填数 nyoj
- NYOJ 32 组合数
- NYOJ 13 Fibonacci数
- calzature hogan rarely home. Parents will be open until the time only to find his son's ranking dr
- JavaIO
- chaussures femme pas cher the case came to a standstill. November 4.
- abercrombie e fitch research
- plats christian louboutin there is a very important reason is that the identity of his 'special' --
- NYOJ-Fibonacii数
- iOS的影片播放 MediaPlayer 和 AVPlayer
- 字符编码笔记:ASCII,Unicode和UTF-8
- 小黑小波比.sql的limit offset 和desc asc使用
- Learning a Deep Convolutional Network for Image Super-Resolution(泛读)
- Ubuntu命令的学习
- 检测iphone 是不是震动模式 并播放音频文件
- kali linux Aircrack-ng
- hdu 5002 (LCT模板)