[Ruby][백준] 사분면 고르기 (14681)

PersesTitan·2022년 6월 10일
0

RubyBaekJoon

목록 보기
18/46
post-thumbnail

조건문

풀이 : 값을 받아 사분면의 위치를 구합니다.

코드 경고선


코드

x = gets.chomp.to_i
y = gets.chomp.to_i

if x>0 and y>0
  puts "1"
elsif x<0 and y>0
  puts "2"
elsif x<0 and y<0
  puts "3"
else
  puts "4"
end

코드 링크

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

0개의 댓글