Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int liczba, wynik = 1;
- int obliczanie(int wynik)
- {
- if (liczba == 0)
- return 1;
- else return wynik * obliczanie(wynik-1);
- }
- int main(){
- cout << "Podaj liczbe: ";
- cin >> liczba;
- cout << liczba << "! = ";
- cout << obliczanie(wynik);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement