Advertisement
MeehoweCK

Untitled

Jul 31st, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. // wywołanie rekurencyjne (wywołanie funkcji wewnątrz samej siebie)
  6. long long silnia(int liczba)
  7. {
  8.     if(liczba == 0)
  9.         return 1;
  10.     return liczba * silnia(liczba - 1);
  11. }
  12.  
  13. int main()
  14. {
  15.     cout << silnia(13) << endl;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement