我在CodeBlocks
中编写了以下的程序,结果为9183。然后我在Eclipse
中编写同样的程序运行后返回9220。两个程序都使用了MinGW
。正确结果应该是9183。这个代码有什么问题吗?
谢谢。
#include <iostream>
#include <set>
#include <cmath>
int main()
{
using namespace std;
set<double> set_1;
for(int a = 2; a <= 100; a++)
{
for(int b = 2; b <= 100; b++)
{
set_1.insert(pow(double(a), b));
}
}
cout << set_1.size();
return 0;
}