#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<windows.h>
int main()
{
int i = 0;
double sum = 0.0;
int flag = 1;
for (i = 1; i <= 100; i++)
{
if (1 == i % 2)
{
sum = sum + 1.0 / i;
}
else
sum = sum - 1.0 / i;
}
printf("%f\n", sum);
system("pause");
return 0;
}