// 函数的递归.cpp : Defines the entry point for the console application. // #include "stdafx.h" #in

日期:2022-04-11 08:59:07 人气:1

// 函数的递归.cpp : Defines the entry point for the console application. // #include "stdafx.h" #in

shu()-这个函数少了结尾的大括号}
还有就是,,你想求解斐波那契数列的话,,shu()函数里的判断条件应该是n<=2而不是n>=2;
再者,,如果你想连续输出数列前10位的话,,,count行请用count<<shu(f),,,而不是固定的cout<<shu(10)来始终输出第10位.
修改后的代码如下:
#include "std
    A+
热门评论