简单到发疯
2025-10-25 18:39:02
发布于:江苏
0阅读
0回复
0点赞
好像也没什么可讲的
千万不要算出来再判断!!!
#include <bits/stdc++.h>
#define endl "\n"
#define N 500005
#define ll long long
#define debug freopen("in.txt","r",stdin),freopen("out.txt","w",stdout)
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
ll ans = 1;
for (int i = 1;i <= b;i++)
{
ans *= a;
if(ans > 1000000000)
{
cout << "-1";
return 0;
}
}
cout << ans;
return 0;
}
这里空空如也



有帮助,赞一个