?? pi.cpp
字號:
#include <iostream>
using namespace::std;
const int LOOP = 100000000;
int main()
{
int R=RAND_MAX; //RAND_MAX = 0x7fff;
int x;
int y;
int count=0;
for(int i=0; i<LOOP; i++)
{
x = rand();
y = rand();
if(x*x+y*y<R*R)
count++;
}
cout<<count<<endl;
return 1;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -