10/01/13 21:56:15
rubyで
>>231
f=File.open("out.txt","w")
for i in 1..9 do
for j in 1..9 do
f.printf("%3d"%[i*j])
end
f.puts()
end
f.close
>>232
N=10000
num=0
for i in 1..N
if rand()**2+rand()**2<=1 then num+=1 end
end
puts(4.0*num/N)
#print("PI=",4.0*num/N)