#include int product(int n) { int total; while (n > 0) { n = n-1; total = total*n; } return total; } int main() { int n; cin >> n; cout << product(n) << endl; /* print 1*...*n */ }