标题:分析下面程序中输出的count的值是多少
取消只看楼主
zjs0388
Rank: 1
等 级:新手上路
帖 子:11
专家分:5
注 册:2011-9-7
结帖率:100%
已结贴  问题点数:1 回复次数:1 
分析下面程序中输出的count的值是多少
分析下面程序中输出的count的值是多少,
#include<stdio.h>
#include<stdlib.h>
static int count ;

int
hermite(int n,int x);

int
main(void)
{
    int n = 2,x =1;
    printf("n =2,x=1,result = %d\n count = %d\n",hermite(n,x),count);
    return EXIT_SUCCESS;
}

int hermite(int n,int x    )
{
    count ++;
    if(n<=0)
    {
        return 1;
    }
    else if(n==1)
    {
        return 2*x    ;
    }else
    {
        return 2*x*hermite(n-1,x) -2*(n-1)*hermite(n-1,x);
    }
}
搜索更多相关主题的帖子: include return result count 
2011-09-14 15:14
zjs0388
Rank: 1
等 级:新手上路
帖 子:11
专家分:5
注 册:2011-9-7
得分:0 
printf("n =2,x=1,result = %d\n count = %d\n",hermite(n,x),count);
的输出中count =0,
2011-09-15 10:04



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-349887-1-1.html




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

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