#include<iomanip>
using namespace std;
int main()
{
int n;
double sum, k;
while (true)
{
sum = 0, k = 1;
cin >> n;
if (n == 0)
break;
for (int i = 0; i < n; i++)
{
if (i % 2 == 0)
sum += 4 / k;
else
sum -= 4 / k;
k += 2;
}
cout << fixed << setprecision(5) << sum << endl;
}
return 0;
}
沒有留言:
張貼留言