Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <fstream>
- #include <cmath>
- using namespace std;
- long long n, g=1, l=2, h=1;
- ifstream fin("13.txt");
- ofstream fot("13.out");
- int rekursine()
- {
- if(n%2==0 && l<=n)
- {
- g=g*l;
- l=l+2;
- rekursine();
- }
- if(n%2!=0 && h<=n)
- {
- g*=h;
- h+=2;
- rekursine();
- }
- else
- {
- return g;
- }
- }
- int main()
- {
- fin >> n;
- rekursine();
- fot << g;
- return 0;
- }
Add Comment
Please, Sign In to add comment