文件名称:2014053082053
-
所属分类:
- 标签属性:
- 上传时间:2014-05-30
-
文件大小:528byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
程序1】
题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月 后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? 1.程序分析: 兔子的规律为数列1,1,2,3,5,8,13,21.... 2.程序源代码: main() { long f1,f2 int i f1=f2=1
for(i=1 i<=20 i++)
{ printf(" 12ld 12ld",f1,f2)
if(i 2==0) printf("\n") /*控制输出,每行四个*/ f1=f1+f2 /*前两个月加起来赋值给第三个月*/ f2=f1+f2 /*前两个月加起来赋值给第三个月*/ } }
-Program 1] Topic: classical problem: a pair of rabbits, from the first three months after birth month, a pair of rabbits are born, grow a small rabbit to the first month and three months after the birth of a pair rabbit, hare, if not death, the total number of rabbits asked how much per month? 1 Program analysis: the law of the rabbit number of columns 1,1,2,3,5,8,13,21 .... 2 source code:. Main () {longf1, f2 inti f1 = f2 = 1 for (i = 1 i < = 20 i++) {printf (" 12ld 12ld" , f1, f2) if (i 2 == 0) printf (" \ n" ) /* Control output per line four*/f1 = f1+f2 /* add up to two months before the assignment to a third Month*/f2 = f1+f2 /* two months before the first three months of assignment to add* /}} =============== ======================
题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月 后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? 1.程序分析: 兔子的规律为数列1,1,2,3,5,8,13,21.... 2.程序源代码: main() { long f1,f2 int i f1=f2=1
for(i=1 i<=20 i++)
{ printf(" 12ld 12ld",f1,f2)
if(i 2==0) printf("\n") /*控制输出,每行四个*/ f1=f1+f2 /*前两个月加起来赋值给第三个月*/ f2=f1+f2 /*前两个月加起来赋值给第三个月*/ } }
-Program 1] Topic: classical problem: a pair of rabbits, from the first three months after birth month, a pair of rabbits are born, grow a small rabbit to the first month and three months after the birth of a pair rabbit, hare, if not death, the total number of rabbits asked how much per month? 1 Program analysis: the law of the rabbit number of columns 1,1,2,3,5,8,13,21 .... 2 source code:. Main () {longf1, f2 inti f1 = f2 = 1 for (i = 1 i < = 20 i++) {printf (" 12ld 12ld" , f1, f2) if (i 2 == 0) printf (" \ n" ) /* Control output per line four*/f1 = f1+f2 /* add up to two months before the assignment to a third Month*/f2 = f1+f2 /* two months before the first three months of assignment to add* /}} =============== ======================
(系统自动生成,下载前可以参看下载内容)
下载文件列表
2014053082053.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.