fork download
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int silnia(int liczba)
  5. {
  6. if (liczba<2) return liczba;
  7. return liczba*silnia(liczba-1);
  8. }
  9. int main()
  10. {
  11. int s;
  12. cout<<"Podaj liczbe"<<endl;
  13. cin>>s;
  14. cout<<silnia(s)<<endl;
  15. system("PAUSE");
  16. return 0;
  17.  
  18.  
  19. }
Success #stdin #stdout #stderr 0.01s 5276KB
stdin
Standard input is empty
stdout
Podaj liczbe
0
stderr
sh: 1: PAUSE: not found