60pts求调,回帖必关
查看原帖
60pts求调,回帖必关
1339166
xuzhengfei666楼主2024/11/6 21:59
#include<bits/stdc++.h>
using namespace std;
int a,b;
long long c=1;
int main()
{
	cin>>a>>b;
	if(b==0)cout<<1;
	else 
	{
		for(int i=1;i<=b;i++)
		{
			c*=a;
		}
		if(c<=10e9)
		{
			cout<<c;
		}
		else 
		{
			cout<<-1;
			return 0;	
		}
	}
	return 0; 
}
2024/11/6 21:59
加载中...