Untitled

Anonymous
plain_text
03/01/2023 8:30 PM
336 B
16
Indexable
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int fact(int x) {
	int g = x;
	for (int i = 1; i < x; i++){
		g *= i;
	}
	return g;
}
int main() {
	int a;
	cin >> a;
	cout << fact(a);
}
Editor is loading...