백준 2083

hong030·2023년 1월 27일
0
  • solved.ac 기준 브론즈 4단계 문제

풀이)
해당 문제는 조건문을 활용할 줄 아는지를 보는 문제이다.
시간 제한이 1초인 것으로 보아 시간복잡도는 n 이하여야 한다.

내 코드)

import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		
		while(true) {
			String str = s.next();
			int age = s.nextInt();
			int weight = s.nextInt();
			
			if((str.equals("#")) &&(age == 0) && (weight == 0))
				break;
			
			if((age > 17) || (weight >= 80)) {
				System.out.print(str + " " + "Senior");
			}else {
				System.out.print(str + " " + "Junior");
			}
		}
	}
}
profile
자바 주력, 프론트 공부 중인 초보 개발자. / https://github.com/hongjaewonP

0개의 댓글