?? c3-12.cpp
字號:
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{int s=1;
double n=1,t=1,pi=0;
while((fabs(t)) > 1e-7)
{pi=pi+t;
n=n+2;
s=-s;
t=s/n;
}
pi=pi*4;
cout<<"pi="<<setiosflags(ios::fixed)<<setprecision(6)<<pi<<endl;
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -