可是书上说的是2575耶,望各位大哥再看看,小女子拜谢
#include <iostream>
using namespace std;
void main()
{
double Sum = 0;
for (int N = 1; N < 100; N++) // 从分母为1 加到分母为99
{
for (int i = 1; i <= N; i++)
{
if (i < N)
{
Sum += 2 * (double) i / N;
}
else
{
Sum += (double) i / N;
}
}
}
for (int i = 1; i <= 100; i++)// 加上分母为100的
{
Sum += (double) i / 100;
}
cout << Sum << endl;
return ;
}