以下の設問の解答は所定の解答用紙に記入 して添付書類として提出して下さい.その際に,ファイル名 を必ず自分にあったものに変更することと学生番号と氏名を記入すること を忘れないようにして下さい.
include Math num = 0 for x in -5..5 for y in -5..5 for z in -5..5 r2 = x*x + y*y + z*z if r2 >= 4.8*4.8 && r2 <= 5*5 printf "(%2d, %2d, %2d)", x, y, z printf " distance r = %2.2f\n", sqrt(r2) num += 1 end end end end printf "Number of coordinates: %d\n", num |
Back |