SHARE
TWEET

Untitled

a guest Jan 21st, 2020 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. using namespace std;
  3. int liczba, wynik = 1;
  4.  
  5. int obliczanie(int wynik)
  6. {
  7.  
  8.  
  9.     if (liczba == 0)
  10.         return 1;
  11.     else return wynik * obliczanie(wynik-1);
  12.    
  13. }
  14.  
  15.  
  16. int main(){
  17.     cout << "Podaj liczbe: ";
  18.     cin >> liczba;
  19.     cout << liczba << "! = ";
  20.     cout << obliczanie(wynik);
  21.  
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top