Skip to content

Instantly share code, notes, and snippets.

@Thiago4532
Created June 14, 2019 12:29
Show Gist options
  • Save Thiago4532/56c54083f1171d512fa7f116f85b5cfe to your computer and use it in GitHub Desktop.
Save Thiago4532/56c54083f1171d512fa7f116f85b5cfe to your computer and use it in GitHub Desktop.
// Codigo por Lidiane Gomes
#include <bits/stdc++.h>
using namespace std;
int fat(int n)
{
if(n == 1)
return 1;
return n * fat(n - 1);
}
int main(int argc, char** argv)
{
int p;
cin >> p;
cout << fat(p) << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment