C++关于递归调用的问题求解。。。

[复制链接]
查看11 | 回复2 | 2010-6-19 14:11:24 | 显示全部楼层 |阅读模式
#include
using namespace std;
long fac(int n)
{
long f;
if(n>n;
y=fac(n);
cout>n; y=fac(n); cout<<n<<"!="<<y<<endl;}其
回复

使用道具 举报

千问 | 2010-6-19 14:11:24 | 显示全部楼层
"#includeusingnamespacestd;longfac(intn){longf;if(n<0)//假如输入的数小于0,输出数据错误提醒cout<<"n<0,dataerror!"<<endl;elseif(n==0)//假如输入的数等
回复

使用道具 举报

千问 | 2010-6-19 14:11:24 | 显示全部楼层
#includeusingnamespacestd;longfac(intn){longf;if(n<0)//如果输入的数小于0,输出数据错误提示cout<<"n<0,dataerror!"<<endl;elseif(n==0)//如果输入的数等于0,输出y=1;(由f传递给y的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行