精華區beta NTUBIME101HW 關於我們 聯絡資訊
#include <iostream> #include <cmath> using namespace std; int main() { double pi=0.0; for(float i=1.0;i<=50;i++) { pi=pi+1.0/i/i; } pi=sqrt(pi*6); cout << "π = " << pi<<endl; system("pause"); return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.241.88