标题:写的程序怎么不能运行,是不是有问题?
取消只看楼主
xiayuadmin
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2004-11-12
 问题点数:0 回复次数:0 
写的程序怎么不能运行,是不是有问题?

提干:编写程序,求s=s1+s2+s3+s4的值,其中:

s1=1+1/2+1/3+.....+1/50

s2=1+1/2+1/3+.....+1/100

s3=1+1/2+1/3+.....+1/150

s4=1+1/2+1/3+.....+1/200

我写的程序为:

#include "stdio.h" float Fcount(n) int n; { float s; int i; s=0; for(i=1;i<n;i++) s+=1/(float)i; return(n); } main() {float sum; sum=Fcount(50)+Fcount(100)+Fcount(150)+Fcount(200) printf("sum=%f",sum); }

搜索更多相关主题的帖子: 运行 
2004-11-17 09:19



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-7775-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.931347 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved