JakubKaczmarek_123

zadanie 5

Jan 22nd, 2021
41
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 POTEGA(int x, int y);
  5. int main(){
  6. cout << POTEGA(2, 6) << endl;
  7. cout << POTEGA(2, 2) << endl;
  8. cout << POTEGA(4, 3) << endl;
  9. cout << POTEGA(4, 5) << endl;
  10. }
  11. int POTEGA(int x, int y){
  12. int z = x;
  13. for (int i = 1; i < y; i++) z *= x;
  14. return z;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment