看板 NTUBIME-99 關於我們 聯絡資訊
#include "stdafx.h" #include "iostream" using std::cout; using std::cin; int _tmain(int argc, _TCHAR* argv[]) { double PI=0.0; double sign=1.0; for(int i=1; i<9999999;i=i+2) { PI=PI+sign*1.0/i; sign=sign=sign*-1.0; } PI= 4.0*PI; cout<<PI; cin.get(); return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.183.98 apple579:轉錄至看板 NTUBIME99-HW 10/26 22:49