TheMagnusRex

pavlova4.1

Jan 13th, 2021
577
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using namespace std;
  2.  
  3. #include <iostream>
  4.  
  5. double fact(int x){
  6.     if (x>1){
  7.         return x*fact(x-1);
  8.     }
  9.     else{
  10.         return 1.0;
  11.     }
  12. }
  13.  
  14. int main(){
  15.     int a;
  16.     cout<<"input:";
  17.     cin>>a;
  18.     cout<<a<<"!="<<fact(a);
  19.     return 0;
  20. }
RAW Paste Data