返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int f(int x)
  5.    if(x==1)
  6.     return 1;
  7.      else
  8.      return x*f(x-1)
  9. int main()
  10. {   
  11.     re:
  12.     int x;
  13.     cout<<"階承?"<<endl;
  14.     cin>>x;
  15.     cout<<x*f(x-1)<<endl;      
  16.    
  17.     system("pause");
  18.     return 0;   
  19. }
複製代碼

TOP

返回列表