#include<bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if (pow(a, b) <= pow(10, 9)) { cout << (long long) round(pow(a, b)); } else { cout << "-1" << endl; } return 0; }
其实这道题就是pow函数和round函数的考察,我想问一下有没有其他做法,我想了解一下。