본문 바로가기

프로그래밍 문제/정올

531 : 선택제어문 - 자가진단4

Java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double weight = sc.nextDouble();
 
        if (weight < 50.80)
            System.out.println("Flyweight");
        else if (weight < 61.23)
            System.out.println("Lightweight");
        else if (weight < 72.57)
            System.out.println("Middleweight");
        else if (weight < 88.45)
            System.out.println("Cruiserweight");
        else
            System.out.println("Heavyweight");
    }
}
cs