Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- float potega(float p, float w) { //p^w
- int wynik = 1;
- for (int i = 1; i <= w; i++) {
- wynik = wynik * p;
- }
- return wynik;
- }
- int main()
- {
- unsigned int s;
- int n;
- float wynik=1;
- cin >> n >> s;
- if (n >= 0 && s >= 2) {
- wynik = potega(n,1/(float)s);
- floor(wynik);
- cout << wynik << endl;
- }
- return 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement