Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. void silnia(int n, int counter, int wartosc){
  2. //cout << "Debug: " << n;
  3. if (n < 0){
  4. cout << "Silnia nie moze byc mniejsza od 0!" << endl;
  5. return;
  6. }
  7. counter++;
  8. if (n == 0){
  9. cout << "Wartosc silni to: " << wartosc << ", a ilosc wywolan funkcji to: " << counter << endl;
  10. return;
  11. }
  12. wartosc *= n;
  13. n--;
  14. if (n > 0){
  15. silnia(n, counter, wartosc);
  16. }else{
  17. cout << "Wartosc silni to: " << wartosc << ", a ilosc wywolan funkcji to: " << counter << endl;
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement