-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfctrl2.cpp
More file actions
46 lines (40 loc) · 751 Bytes
/
fctrl2.cpp
File metadata and controls
46 lines (40 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream>
#include <algorithm>
#include <bitset>
#include <string>
#include <vector>
#include <utility>
#include <list>
#include <set>
#include <map>
using namespace std;
string add(string a, string b) {
string res;
int sum = 0, carry = 0;
int len = max(a.length(), b.length());
for (int i=len-1; i>-1; i--) {
res.push_back();
}
}
string multiply(string a, string b) {
string res;
}
string factorial(string n) {
if (n == "1")
return res;
string res;
res = multiply(n, factorial(n-1));
return res;
}
int main() {
freopen("input.txt", "r", stdin);
// freopen("../output.txt", "w", stdout);
int test_cases;
cin >> test_cases;
string n;
while (test_cases--) {
cin >> n;
cout << factorial(n) << endl;
}
return 0;
}