Advertisement
olaaa

Untitled

Nov 18th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. float potega(float p, float w) { //p^w
  8. int wynik = 1;
  9. for (int i = 1; i <= w; i++) {
  10. wynik = wynik * p;
  11. }
  12. return wynik;
  13. }
  14. int main()
  15. {
  16.  
  17. unsigned int s;
  18. int n;
  19. float wynik=1;
  20. cin >> n >> s;
  21. if (n >= 0 && s >= 2) {
  22. wynik = potega(n,1/(float)s);
  23. floor(wynik);
  24.  
  25. cout << wynik << endl;
  26.  
  27. }
  28. return 0
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement