摘要: zxp学长告诉我两种计算pi值得办法,第一种是pi/4=1-1/3+1/5-1/7……(课本上的传统方法)第二种方法是这种方法的证明(以上由zxp学长找的资料给我的……)用C++写出这两种方法求解pi的过程,然后比较这两种方法收敛的速度 1 #include 2 #include 3 #include 4 using namespace std; 5 int main(){ 6 double pi1=0; 7 double pi2; 8 for(double i=0;i<1500000;i++){//the method in text book should use ... 阅读全文
posted @ 2014-02-17 21:42 悠悠我心。 阅读(4734) 评论(1) 推荐(0)
摘要: Manao is designing the genetic code for a new type of algae to efficiently produce fuel. Specifically, Manao is focusing on a stretch of DNA that encodes one protein. The stretch of DNA is represented by a string containing only the characters 'A', 'T', 'G' and 'C'.Ma 阅读全文
posted @ 2014-02-17 20:26 悠悠我心。 阅读(264) 评论(0) 推荐(0)
摘要: B.WordFoldingYouwillreceive5pointsforsolvingthisproblem.Manaohasinventedanewoperationonstringsthatiscalledfolding.Eachfoldhappensbetweenapairofconsecutivelettersandplacesthesecondpartofthestringabovefirstpart,runningintheoppositedirectionandalignedtothepositionofthefold.Usingthisoperation,Manaoconve 阅读全文
posted @ 2014-02-17 12:51 悠悠我心。 阅读(324) 评论(0) 推荐(0)