Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void silnia(int n, int counter, int wartosc){
- //cout << "Debug: " << n;
- if (n < 0){
- cout << "Silnia nie moze byc mniejsza od 0!" << endl;
- return;
- }
- counter++;
- if (n == 0){
- cout << "Wartosc silni to: " << wartosc << ", a ilosc wywolan funkcji to: " << counter << endl;
- return;
- }
- wartosc *= n;
- n--;
- if (n > 0){
- silnia(n, counter, wartosc);
- }else{
- cout << "Wartosc silni to: " << wartosc << ", a ilosc wywolan funkcji to: " << counter << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement