haha1235 |
|
||
2013年10月5日
摘要:
#include #includeint main(void){ int denominator,flag; double item,pi; flag=1; denominator=1; item=1.0; pi=0; while(fabs(item)>=0.0001){ item=flag*1.0/denominator; pi=pi+item; flag=-flag; denominator=denominator+2; } pi=pi*4; printf("pi=%.4f\n",pi); retur... 阅读全文
|
Copyright © 2024 haha1235
Powered by .NET 9.0 on Kubernetes |