Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- unsigned long long rec_fact(unsigned long long a)
- {
- if (a == 0)
- {
- return 1;
- }
- else
- {
- return a*rec_fact(a - 1);
- }
- }
- int main()
- {
- unsigned int a;
- setlocale(LC_ALL, "russian");
- system("color 0A");
- cin >> a;
- cout << rec_fact(a) << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment