亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cannon.sh

?? 一本完整的描述Unix Shell 編程的工具書的所有范例
?? SH
字號:
#!/bin/bash# cannon.sh: Approximating PI by firing cannonballs.# This is a very simple instance of a "Monte Carlo" simulation:#+ a mathematical model of a real-life event,#+ using pseudorandom numbers to emulate random chance.#  Consider a perfectly square plot of land, 10000 units on a side.#  This land has a perfectly circular lake in its center,#+ with a diameter of 10000 units.#  The plot is actually mostly water, except for land in the four corners.#  (Think of it as a square with an inscribed circle.)##  We will fire iron cannonballs from an old-style cannon#+ at the square.#  All the shots impact somewhere on the square,#+ either in the lake or on the dry corners.#  Since the lake takes up most of the area,#+ most of the shots will SPLASH! into the water.#  Just a few shots will THUD! into solid ground#+ in the four corners of the square.##  If we take enough random, unaimed shots at the square,#+ Then the ratio of SPLASHES to total shots will approximate#+ the value of PI/4.##  The reason for this is that the cannon is actually shooting#+ only at the upper right-hand quadrant of the square,#+ i.e., Quadrant I of the Cartesian coordinate plane.#  (The previous explanation was a simplification.)##  Theoretically, the more shots taken, the better the fit.#  However, a shell script, as opposed to a compiled language#+ with floating-point math built in, requires a few compromises.#  This tends to lower the accuracy of the simulation, of course.DIMENSION=10000  # Length of each side of the plot.                 # Also sets ceiling for random integers generated.MAXSHOTS=1000    # Fire this many shots.                 # 10000 or more would be better, but would take too long.PMULTIPLIER=4.0  # Scaling factor to approximate PI.get_random (){SEED=$(head -1 /dev/urandom | od -N 1 | awk '{ print $2 }')RANDOM=$SEED                                  #  From "seeding-random.sh"                                              #+ example script.let "rnum = $RANDOM % $DIMENSION"             #  Range less than 10000.echo $rnum}distance=        # Declare global variable.hypotenuse ()    # Calculate hypotenuse of a right triangle.{                # From "alt-bc.sh" example.distance=$(bc -l << EOFscale = 0sqrt ( $1 * $1 + $2 * $2 )EOF)#  Setting "scale" to zero rounds down result to integer value,#+ a necessary compromise in this script.#  This diminshes the accuracy of the simulation, unfortunately.}# main() {# Initialize variables.shots=0splashes=0thuds=0Pi=0while [ "$shots" -lt  "$MAXSHOTS" ]           # Main loop.do  xCoord=$(get_random)                        # Get random X and Y coords.  yCoord=$(get_random)  hypotenuse $xCoord $yCoord                  #  Hypotenuse of right-triangle =                                              #+ distance.  ((shots++))  printf "#%4d   " $shots  printf "Xc = %4d  " $xCoord  printf "Yc = %4d  " $yCoord  printf "Distance = %5d  " $distance         #  Distance from                                               #+ center of lake --                                              #  the "origin" --                                              #+ coordinate (0,0).  if [ "$distance" -le "$DIMENSION" ]  then    echo -n "SPLASH!  "    ((splashes++))  else    echo -n "THUD!    "    ((thuds++))  fi  Pi=$(echo "scale=9; $PMULTIPLIER*$splashes/$shots" | bc)  # Multiply ratio by 4.0.  echo -n "PI ~ $Pi"  echodoneechoecho "After $shots shots, PI looks like approximately $Pi."# Tends to run a bit high . . . # Probably due to round-off error and imperfect randomness of $RANDOM.echo# }exit 0#  One might well wonder whether a shell script is appropriate for#+ an application as complex and computation-intensive as a simulation.##  There are at least two justifications.#  1) As a proof of concept: to show it can be done.#  2) To prototype and test the algorithms before rewriting#+    it in a compiled high-level language.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产三级国产有无不卡 | 欧美日韩一区视频| 国产成人h网站| 国产剧情在线观看一区二区| 国内欧美视频一区二区| 国产综合色在线视频区| 国产在线播精品第三| 国产一区二三区| 国产精品羞羞答答xxdd| 成人性色生活片| 成人激情综合网站| 91亚洲精品一区二区乱码| 99精品视频中文字幕| 91丨国产丨九色丨pron| 欧美日韩一区小说| 精品国产一区二区三区av性色| 日韩女优电影在线观看| 久久精品一区四区| 亚洲欧美综合另类在线卡通| 一区二区三区四区在线播放| 亚洲一区二区美女| 久久99精品国产.久久久久久| 国产一区二区不卡老阿姨| fc2成人免费人成在线观看播放| 99久久精品99国产精品| 欧美性做爰猛烈叫床潮| 精品久久久久久久久久久久包黑料| 精品国产免费一区二区三区四区| 26uuu国产电影一区二区| 1024国产精品| 老司机精品视频导航| 成a人片国产精品| 欧美精品在线视频| 国产欧美一区在线| 亚洲午夜精品在线| 国产在线不卡视频| 欧美日韩在线播放一区| 国产午夜精品福利| 亚洲一级片在线观看| 国产aⅴ综合色| 欧美日韩精品一区二区三区蜜桃 | 亚洲免费av高清| 久久精品国产亚洲高清剧情介绍| 91丨porny丨蝌蚪视频| 欧美成人午夜电影| 一区二区三区在线影院| 国产中文一区二区三区| 欧美三级欧美一级| 欧美国产激情二区三区| 日韩av二区在线播放| 色婷婷一区二区三区四区| 26uuu另类欧美亚洲曰本| 五月天一区二区| 色噜噜狠狠一区二区三区果冻| 精品国产乱码久久久久久图片| 亚洲一区二区三区四区的| 不卡一区在线观看| 中文字幕欧美日韩一区| 精品综合久久久久久8888| 欧美日韩dvd在线观看| 亚洲同性同志一二三专区| 国产激情一区二区三区四区| 在线不卡a资源高清| 一区二区三区四区亚洲| 国产91精品一区二区| 欧美mv和日韩mv的网站| 蜜臀av国产精品久久久久| 欧美精品在线观看播放| 日韩在线a电影| 91麻豆精品国产91久久久久久久久| 一区二区成人在线| 在线观看91视频| 亚洲一区在线免费观看| 在线播放一区二区三区| 香蕉加勒比综合久久| 欧美色图在线观看| 午夜天堂影视香蕉久久| 欧美日韩视频第一区| 亚洲国产精品久久久男人的天堂 | 欧美一区二区福利视频| 首页国产欧美久久| 欧美成人精品3d动漫h| 久久99精品国产麻豆不卡| 久久日一线二线三线suv| 国产精品一区久久久久| 国产精品全国免费观看高清 | 日韩不卡一区二区| 日韩一区二区在线观看| 精品亚洲国产成人av制服丝袜| 欧美电影免费提供在线观看| 国产一区二区三区免费看| 日本一区二区免费在线| av激情亚洲男人天堂| 亚洲婷婷在线视频| 欧美日韩亚洲丝袜制服| 美女看a上一区| 精品福利视频一区二区三区| 国产成人午夜视频| 一区二区三区精品视频在线| 欧美视频中文一区二区三区在线观看 | 日韩一区二区免费在线观看| 亚洲香肠在线观看| 精品欧美一区二区三区精品久久| 国产成人小视频| 亚洲一区二三区| 久久久久久久久久久久久夜| 北条麻妃国产九九精品视频| 婷婷一区二区三区| 久久久久9999亚洲精品| 色偷偷一区二区三区| 精品在线播放免费| 一区二区三区资源| 精品福利av导航| 在线视频一区二区三| 国产美女av一区二区三区| 亚洲综合在线第一页| 久久久久久久久久久久久久久99| 在线观看视频91| 国产老肥熟一区二区三区| 午夜伦欧美伦电影理论片| 中文久久乱码一区二区| 91精品国产入口在线| 色综合久久久网| 高清在线不卡av| 美女在线视频一区| 亚洲自拍另类综合| 中文字幕不卡在线播放| 日韩欧美国产综合| 欧美疯狂做受xxxx富婆| 91香蕉国产在线观看软件| 国产精品888| 久久精品国产77777蜜臀| 亚洲精品国久久99热| 国产精品久久看| 亚洲国产成人午夜在线一区| 精品欧美一区二区在线观看| 911精品国产一区二区在线| 91在线看国产| www.亚洲色图| 国产1区2区3区精品美女| 极品少妇一区二区三区精品视频| 午夜一区二区三区在线观看| 亚洲精品国产品国语在线app| 国产亲近乱来精品视频| 欧美国产激情一区二区三区蜜月| 精品国产精品一区二区夜夜嗨| 91精品国产综合久久婷婷香蕉 | 亚洲欧洲精品一区二区精品久久久| 久久日一线二线三线suv| 精品国产乱码久久久久久久久| 欧美日韩国产精品自在自线| 欧洲亚洲国产日韩| 欧美亚洲综合一区| 欧美午夜宅男影院| 欧美美女一区二区三区| 91精品中文字幕一区二区三区| 69久久99精品久久久久婷婷| 欧美日韩高清一区二区| 欧美喷潮久久久xxxxx| 91麻豆精品91久久久久久清纯| 欧美一区二区私人影院日本| 日韩午夜精品电影| 精品国产乱码久久久久久免费| 久久嫩草精品久久久精品| 国产亚洲综合性久久久影院| 亚洲国产精品t66y| 亚洲美女在线一区| 五月天丁香久久| 久久99久国产精品黄毛片色诱| 国产美女精品在线| 色悠悠亚洲一区二区| 欧美日韩大陆在线| 久久―日本道色综合久久| 国产精品美女久久久久av爽李琼| √…a在线天堂一区| 亚洲午夜在线电影| 加勒比av一区二区| 成人午夜在线视频| 777亚洲妇女| 国产婷婷色一区二区三区 | 欧美美女bb生活片| 日韩精品中午字幕| 中文字幕中文字幕中文字幕亚洲无线 | 高清在线不卡av| 欧美午夜影院一区| 久久久综合网站| 一区二区三区四区激情| 香蕉加勒比综合久久| 国产成人精品aa毛片| 欧美日韩在线观看一区二区 | 欧美一级高清片| 国产精品天美传媒| 日韩国产欧美在线观看| 成人手机在线视频| 欧美日韩综合不卡| 国产精品欧美极品| 久草精品在线观看| 欧美日韩在线播| 亚洲精品第1页| 国产精品资源在线观看|