一、流程图;
二、源代码;
# define _CRT_SECURE_NO_WARNINGS
# include <stdio.h>
int main()
{
//初始化变量值;
int fenmu = 2;
int result = 1;
int fuhao = 1;
//执行循环;
while (fenmu < 100)
{
//运算;
fuhao = (-1) * fuhao;
result = result + fuhao * (1 / fenmu);
//循环值;
fenmu++;
}
//打印结果;
printf("%d\n", result);
return 0;
}