50分求助
查看原帖
50分求助
1011874
GuiyuanCo楼主2023/9/24 10:37
#include <iostream>
using namespace std;
long long power(long long a,int b)
{
    for (int i=0;i<b;i++)
    {
        a*=b;
        if (a>1000000000)
        {
            return -1;
        }
    }
    return a;
}
int main()
{
    long long a,b;
    scanf("%lld%lld",&a,&b);
    cout<<power(a,b);
}
2023/9/24 10:37
加载中...