[Ruby][백준] 검증수 (2475)

PersesTitan·2022년 8월 28일
0

RubyBaekJoon

목록 보기
43/46

해설
값을 받은뒤 계산하여 출력하면됩니다.

코드 경고선


nums = gets.chomp.split(" ")
total = nums.pop.to_i**2
nums.each { |n|
  total += n.to_i**2
}
puts total%10
profile
안녕하세요 페르세스 티탄입니다! 부족한 부분이 많이 있겠지만 잘부탁드립니다.

0개의 댓글