Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- long long n;
- long long fac(long long n)
- {
- if(n == 0) return 1;
- if(n == 1) return 1;
- return n * fac( n - 1 );
- }
- int main()
- {
- cin >> n;
- if(n >= 0) cout << fac(n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement