Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int silnia(int n)
  6. {
  7. if (n==1)
  8. return 1;
  9. else
  10. return n*silnia(n-1);
  11. }
  12.  
  13. int main()
  14. {
  15. int n;
  16. cout << "Podaj liczbe z ktorej chcesz obliczyc silnie: " << endl;
  17. cin >> n;
  18. cout << "Silnia: " <<silnia(n)<<endl;
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement