Skip to content

Instantly share code, notes, and snippets.

View giruzou's full-sized avatar

DrqYuto(みなと giruzou

View GitHub Profile
puts gets.split.join(",")
puts gets.split.max
def fact(n)
(1..n).to_a.inject(1) {|f, i| f*i}
end
require 'prime';
puts gets.to_i.prime?
puts gets.split.index("1")+1
puts Math::PI
#=>3.141592653589793
"100Qiita".to_i
@giruzou
giruzou / file0.sh
Created July 24, 2018 10:38
Rubyでのダブルクオーテーション(")をエスケープ処理する方法 ref: https://qiita.com/DrqYuto/items/67df6755560bb2fcd32d
ruby -e "puts \"a\""
@giruzou
giruzou / file0.txt
Created July 24, 2018 10:39
Rubyでの配列の数、要素の長さの出し方の3つめ? ref: https://qiita.com/DrqYuto/items/823a424d5093eb1ecb1e
numbers = [1, 2, 5, 5, 1, 3, 1, 2, 4, 3]
puts numbers.count(1)
puts numbers.count