JakubKaczmarek_123

z3

Dec 4th, 2020 (edited)
44
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. #include <math.h>
  3. using namespace std;
  4. int a, b;
  5.  
  6. int main()
  7. {
  8. cout << "podaj liczbe: " << endl;
  9. cin >> a;
  10. if (a < 0) cout << "nie mozna policzyc silni liczby ujemnej";
  11. else if (a == 0) cout << "0! = 1";
  12. else {
  13. b = 1;
  14. for (int i = 1; i <= a; i++) b *= i;
  15. cout << b << endl;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment