#include <iostream>
#include <cmath>

bool pPow(int x, int n) {
  int m = (int)pow(x, 1.0/n);
  if (x == pow(m, n))
    return true;
/********************************/
  if (x == pow(m + 1, n))
    return true;
/********************************/
  return false;
}

int const y_ulimit = 10;
int const n_ulimit = 10;
int main() {
  /* y^n = x */
  for (int y = 2; y <= y_ulimit; y++) {
    int x = 1;
    for (int n = 1; n <= n_ulimit; n++) {
      x *= y;
      if (!pPow(x, n)) {
        std::cout << "pPow(" << x << "," << n <<") == false!!" << std::endl;
        std::cout << y << "^" << n << ": " << x << std::endl;
      }
    }        
  }        
  return 0;
}
/* end */
