s=0; (1..100).each{|a| s+=a }; print s

설명:
  1. s=0 으로 선언한다.
  2. 1~100 까지 돌면서 s에 더한다.
  3. s를 출력한다.

결과:
  5050



Posted by stekilove
,