实例3.4
来源:互联网 发布:软件质量保证 编辑:程序博客网 时间:2024/06/11 18:40
#include "stdio.h"
main()
{ int n=1;
float sum=0.0;
while((float)1/n>=1e-4)
{ sum=sum+(float)1/n;
n=n+2;
}
printf("sum=%f/n",sum);
getch();
}
来源:互联网 发布:软件质量保证 编辑:程序博客网 时间:2024/06/11 18:40
#include "stdio.h"