_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › 覈豺企ゼ襦覯朱譯殊蟲蠍
|
|
[edit]
1 覓語 #覦讌襴 100 .
螳襯 蠏語 1/4 碁ゼ 襷. (2覿覃) 2螳(x,y)襯 覦貅 0朱覿 碁ゼ 覯企讌 覯企讌 讌襯 譬襯 谿. 狩螻殊 襴 x^2 + y^2 = z^2 企蟾 sqrt(z^2) 覃 朱覿 100 願讌 願讌 . 企ゼ 10000 覦覲牛 豢 譯殊 蟲. [edit]
2 T-SQL襦 蟲 #declare @i int , @x float , @y float , @r int , @in_count float , @out_count float set @r = 100 set @i = 1 set @in_count = 0 set @out_count = 0 while(@i <= 10000) begin set @x = rand() * @r set @y = rand() * @r if sqrt(@x*@x + @y*@y) > @r set @out_count += 1 else set @in_count += 1 set @i += 1 end print @in_count/@i * 4 --2覿覃企 朱襦 4襯 螻燕伎. 3.16128 .
磯Μ螳 螻 pi螳 3.141592 觜る企Μ.
鏤
|
蠏碁所 ロ 讌 襷 碁襯 襴糾 襷 . (れ梗) |