1樓:匿名使用者
private sub form_click()dim i as long, f as integer, pi as single
i = 1
f = 1
dopi = pi + (1 / i) * ff = -f
i = i + 2
loop while 1 / i > 0.00001msgbox 4 * pi
end sub
2樓:匿名使用者
let s=0
let e=0.00001
let i=0
let sign=-1
do while 1.0/(2*i+1)>=elet sign=-sign
let s=s+sign*1.0/(2*i+1)let i=i+1
loop
let s=s*4
print send
java編寫乙個計算圓周率π的近似值π=4*(1-1/3+1/5-1/7+1/9-1/11+....)
3樓:匿名使用者
import java.io.*;
public class pi
system.out.println(4*sum);}}終於申訴成功~~~
4樓:紅塵莫問_離經
public class mypi
system.out.println("π的近似值=" + sum * 4);}}
5樓:匿名使用者
void main()
printf("π=%f",4*sum);}
6樓:day配角
long cut = 1000000; // 切圓次數double pi = 0;
double a = 1 - 1.0 / 3;
double b = 5;
pi = a;
for (long i = 0; i < cut; i++) else
b += 2;
}system.out.println(pi * 4);
以下是頁面版的,開啟谷歌瀏覽器,在貼上到控制台按回車鍵即可。
var cut = 1000000; // 切圓次數var pi = 0;
var a = 1 - 1.0/3;
var b = 5;
pi = a;
for (var i = 0; i < cut; i++) elseb += 2;
}console.log(pi * 4);
以上準確說是切圓的**。
望採納。
7樓:匿名使用者
n < max;不應該是小於等於吧
C語言。求PI的近似值用c語言程式設計計算pi的近似值
include define offset 0.00001ffloat getpi float a pibefore piafter getpi a 1 return piafter int main 遞迴法 你好,公 bai式為dupi 1 1 2 1 4 1 6 1 8 1 n,c語言代 zhi...
求vb程式設計題目,VB程式設計題目
dim operatingsystem as string,otherequipment as string private sub mand1 click text2.text otherequipment for i 0 to 2 if check1 i value 1 then othereq...
急求vb程式設計題答案,急求VB程式設計題答案
private sub command1 click dim i as integer text1.text list1.list 0 for i 0 to 9 if val list1.list i val text1.text then text1.text list1.list i next ...