Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int funkcja(int n)
- {
- if(n==0) return 1;
- return funkcja(n-2)*n;
- }
- int main()
- {
- int n;
- cout<<"Podaj n z przedzialu <2;30>"<<endl;
- cin>>n;
- if(n<=30)
- {
- n=n-(n%2);
- cout<<funkcja(n)<<endl;
- }
- else
- {
- cout<<"Podales n wieksze niz 30";
- }
- cin.ignore();
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement