JakubKaczmarek_123

zadanie 7

Jan 22nd, 2021
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int SILNIA(int a);
  5. int main(){
  6. cout << SILNIA(0) << endl;
  7. cout << SILNIA(1) << endl;
  8. cout << SILNIA(2) << endl;
  9. cout << SILNIA(3) << endl;
  10. cout << SILNIA(4) << endl;
  11. cout << SILNIA(5) << endl;
  12. cout << SILNIA(6) << endl;
  13. cout << SILNIA(7) << endl;
  14. cout << SILNIA(8) << endl;
  15.  
  16. }
  17. int SILNIA(int a){
  18. int b = 1;
  19. for (int i = 2; i <= a; i++) b *= i;
  20. return b;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment