| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 829 人关注过本帖
标题:[求助]高手兔子产子(非波那契数列)
只看楼主 加入收藏
dyoli
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2005-10-20
收藏
 问题点数:0 回复次数:0 
[求助]高手兔子产子(非波那契数列)

高手请问以下程序错在那里
兔子产子(非波那契数列)
#include<stdio.h>
void main()
{
int n,i,j,un1,un2,un;
clrscr();
puts("********************************************************");
puts("* This is a program to Calculnte Rabbits Numbers. *");
prts("* and the young rabbits group and ban procreats in the *");
prts("* end of the second month.In this way,how many rabbits *");
prts("* are there af;er n henerations? *");
prts("********************************************************");
for(n=2;n<3;)
{
printf(">>please input mumber of generations(n>2):");
scanf("%d",&n);
if(n<3)printf("\n>>Input error!\n");
}
un=un2=1;
printf(">>The numbers of rabbits in firat %d heneration are as follows:\n",n);
printf(("i\t i\t");
for(i=3;j=0;i<=n;i++);
{
un1=un2;
un2=un;
un=un1+un2;
printf( i%8?"%d\t":"%d\n",un);
}
printf("\n");
printf("\n press any key to quit...");

getch();
}

搜索更多相关主题的帖子: 兔子 产子 
2005-11-21 13:42
快速回复:[求助]高手兔子产子(非波那契数列)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030338 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved