[Ruby][백준] A+B - 7 (11021)

PersesTitan·2022년 6월 11일
0

RubyBaekJoon

목록 보기
28/46

반복문

풀이 : 처음에 반복할 횟수를 받고 받은 값을 계산하고 출력하시면 됩니다.

코드 경고선


코드

count = gets.to_i

(1..count).each do|i|
  text = gets.chomp
  a = text.split(" ")[0].to_i
  b = text.split(" ")[1].to_i

  puts "Case ##{i}: #{a+b}"
end

코드 링크

profile
안녕하세요 페르세스 티탄입니다! 부족한 부분이 많이 있겠지만 잘부탁드립니다.

0개의 댓글