c语言求program to output the S value based on the e
答案:1 悬赏:70
解决时间 2021-01-07 03:05
- 提问者网友:心如荒岛囚我终老
- 2021-01-06 10:50
c语言求program to output the S value based on the e
最佳答案
- 二级知识专家网友:不甚了了
- 2021-01-06 11:00
#include
int main()
{
int n;
float S;
printf("\n");
for (n=1;n<102;n++)
{
S = 1.0/n -1.0/(2*n) + 1.0/(3*n) - 1.0/(4*n);
printf(" %0.6f ",S);
if ( n%5== 0 ) printf("\n");
}
fflush(NULL);
return 0;
}
int main()
{
int n;
float S;
printf("\n");
for (n=1;n<102;n++)
{
S = 1.0/n -1.0/(2*n) + 1.0/(3*n) - 1.0/(4*n);
printf(" %0.6f ",S);
if ( n%5== 0 ) printf("\n");
}
fflush(NULL);
return 0;
}
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯