题目
已知斐波那契数列:1,1,2,3,5,8,13,21,34,55.此数列前2009项中能被6整除的数有多少个?
提问时间:2020-07-21
答案
恩,太粗心了,顶楼下的哥们,超级计算机?可不可以增加变量的位数,用多个unsigned long组成?
计算机编程算,我这算得222个 注:我计算斐波那契数的函数是从0开始的,所以counter + 2.
#include
using std::cout;
using std::cin;
using std::endl;
unsigned long fibonacciDyl( unsigned long );
int main()
{
int n= 0;
for ( counter = 0; counter < 2009; counter++ )
{
if ( fibonacciDyl( counter + 2 ) % 6 == 0 )
n++;
}
cout
计算机编程算,我这算得222个 注:我计算斐波那契数的函数是从0开始的,所以counter + 2.
#include
using std::cout;
using std::cin;
using std::endl;
unsigned long fibonacciDyl( unsigned long );
int main()
{
int n= 0;
for ( counter = 0; counter < 2009; counter++ )
{
if ( fibonacciDyl( counter + 2 ) % 6 == 0 )
n++;
}
cout
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
热门考点
- 1中越边界问题:在对越自卫反击战后中越边境国界是如何划分的,中国是亏了么?
- 2镁条和氯气反应有点燃的条件吗
- 3果园里有桃树和杏树共360棵,杏树的棵树比桃树少50棵.桃树和杏树各有几棵?
- 4同温同压下,相同体积的气体含有相同的分子数,为什么是分子数,不是物质的量相等吗
- 5语文这句话有错误吗
- 6在一道减法算式中,被减数、减数、差的和是10,其中差是3.2,那么减数是( ) A.6.8 B.1.8 C.12.3
- 7点C、D是线段AB上,且AC=BD,则AD与BC的大小关系是
- 8Barbara is easy to recognize as she’s the only one of the women who________evening dress.
- 9there are (twenty-two)boysin my class(对括号部分提问)
- 1034.5乘76.5-345乘6.42-123乘1.45