Untitled
#include <iostream> #include <string> #include <iomanip> #include <cmath> using namespace std; int main() { int a; cin >> a; int sum = 1; if (a != 0) { for (int i = 1; i < a; i++) { sum *= i; } } if (a == 0) sum = 0; cout << sum; }
#include <iostream> #include <string> #include <iomanip> #include <cmath> using namespace std; int main() { int a; cin >> a; int sum = 1; if (a != 0) { for (int i = 1; i < a; i++) { sum *= i; } } if (a == 0) sum = 0; cout << sum; }