C#模拟圆周率的算法
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 圆周率{class Program{static void Main(string[] args){double count = 0;var n = 1000;for (double i = 1; i < n; i++){count += 1 / (i * i);}var pi = Math.Pow(count * 6, 0.5);Console.WriteLine(pi);Console.ReadKey( 阅读全文
posted @ 2012-09-10 14:54 zieyee 阅读(309) 评论(0) 推荐(0)
浙公网安备 33010602011771号