Advertisement
shizaero

Untitled

May 18th, 2024
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. long long Fact(int n) {
  5.     if (n == 1 or n == 0) return 1;
  6.     else if (n < 0) return 0;
  7.     else return n*Fact(n-1);
  8. }
  9.  
  10. int main()
  11. {
  12.     std::cout << Fact(6);
  13. }
  14.  
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement