标题:error: ‘f’ cannot be used as a function y=f(n); ...
取消只看楼主
taotao521
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2022-2-15
结帖率:0
已结贴  问题点数:10 回复次数:0 
error: ‘f’ cannot be used as a function y=f(n); 求解
#include <stdio.h>

long f(int n)
    {
    long p;
    if(n==0||n==1)
    p=1;
    else p=f(n-1)*n;
    return p;
    }
int main(void)
{
    int n;
    long y,f(n);
    printf("please input a number:");
    scanf("%d",&n);
    while(n<0)
    {
        printf("error,input again:");
        scanf("%d",&n);
        }
        y=f(n);
        printf("%d!=%ld\n",n,y);
        return 0;
    }
   
搜索更多相关主题的帖子: cannot long printf int function 
2022-02-16 12:18



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




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

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