1:代码如下:

// 4.4.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <iostream>
using namespace std;
long Fac(int n)
{
    if(n==0)
        return 1;
    else
        return n*Fac(n-1);
}
void main()
{
    int n ;
    long f;
    cout << "please input a number" << endl;
      cin >> n ;
    f=Fac(n);
    cout << "Result :" << f << endl;
}
View Code

相关文章:

  • 2022-01-10
  • 2021-06-12
  • 2021-12-05
  • 2022-01-11
  • 2022-01-10
  • 2021-11-22
  • 2022-12-23
猜你喜欢
  • 2022-02-02
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2021-11-17
  • 2022-12-23
相关资源
相似解决方案