Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- int nn = 1;
- int i = 0;
- cin >> n;
- if (n % 2 == 0) {
- i = 2;
- }
- else {
- i = 1;
- }
- while (nn < n) {
- nn = nn * i;
- i += 2;
- }
- cout << nn << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement