输入正整数n,计算1-1/3+1/5-1/7+.的前n项之和.用C语言程序解答
2019-05-30
输入正整数n,计算1-1/3+1/5-1/7+.的前n项之和.用C语言程序解答
优质解答
#include
main( )
{
int denominator ,flag,i,n;
double item,sum;
printf(“Enter n:”);
scanf(“%d”,&n);
denominator = 1;
flag=1;
sum = 0
for(i = 1; i
#include
main( )
{
int denominator ,flag,i,n;
double item,sum;
printf(“Enter n:”);
scanf(“%d”,&n);
denominator = 1;
flag=1;
sum = 0
for(i = 1; i