先贴代码:
#include <bits/stdc++.h>
using namespace std;
int a,b,c;
int main()
{
cin >> a >> b >> c;
for (int i = -1020; i <= 1020; ++i)
{
if(a * pow(i,c) == b)
{
cout << i << endl;
return 0;
}
}
cout << "No solution" << endl;
return 0;
}
我提交上去说我第7个测试点错了,然后我去CF上看:
Input
1 1000 1
Participant's output
No solution
Jury's answer
1000
但是此测试点我在c++上运行输出的是1000
,并不是No solution
为什么会出现这种情况?