1#测试点WA但输出没问题帮忙see有什么问题。
查看原帖
1#测试点WA但输出没问题帮忙see有什么问题。
1421469
him_out楼主2024/10/14 21:19

家人们谁懂啊! first:1#测试点WA,但输出没问题。 (input 12345678 1,output 12345678) second:帮忙seesee有什么问题。

#include <bits/stdc++.h>//2,147,483,647
using namespace std;

int main()
 {
 	long long a,b;
 	cin >> a >> b;
 	if(a == 1||b==0)
 	{
 		cout << 1;
 		return 0;
	 }
 	double c = 1;
 	while(b)
 	{
 		c*=a;
 		b--;
 		if(c>2147483647)
 		{
 			cout << -1;
 			return 0;
		 }
	 }
	 cout << c;
	 return 0;
}


2024/10/14 21:19
加载中...