전체 글 (187) 썸네일형 리스트형 [자바] 정올 534 : 선택제어문 - 자가진단7 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char ch = sc.next().charAt(0); switch(ch){ case 'A': System.out.println("Excellent"); break; case 'B': System.out.println("Good"); break; case 'C': System.out.println("Usually"); break; case 'D': System.out.println("Effort"); break; case 'F': System.out.println("Failure"); .. [자바] 정올 533 : 선택제어문 - 자가진단6 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char S = sc.next().charAt(0); int age = sc.nextInt(); if (age < 18) { if (S == 'M') System.out.println("BOY"); else System.out.println("GIRL"); } else { if (S == 'M') System.out.println("MAN"); else System.out.println("WOMAN"); } } } [자바] 정올 532 : 선택제어문 - 자가진단5 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double a = sc.nextDouble(), b = sc.nextDouble(); if(a >= 4.0 && b >= 4.0) System.out.println('A'); else if(a >= 3.0 && b >= 3.0) System.out.println('B'); else System.out.println('C'); } } [자바] 정올 531 : 선택제어문 - 자가진단4 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double w = sc.nextDouble(); if (w > 88.45) System.out.println("Heavyweight"); else if (w > 72.57 && w 61.23 && w 50.80 && w [자바] 정올 530 : 선택제어문 - 자가진단3 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int age = sc.nextInt(); if( age >= 20) System.out.println("adult"); else System.out.println((20 - age) + " years later"); } } [자바] 정올 529 : 선택제어문 - 자가진단2 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int w = sc.nextInt(); System.out.println(w + 100 - h); if (w + 100 - h > 0) System.out.println("Obesity"); } } [자바] 정올 528 : 선택제어문 - 자가진단1 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); System.out.println(num); if( num < 0) System.out.println("minus"); } } [자바] 정올 115 : 연산자 - 형성평가5 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(), b= sc.nextInt(), c = sc.nextInt(), d = sc.nextInt(); System.out.println( a > c && b > d ? 1:0); } } 이전 1 ··· 10 11 12 13 14 15 16 ··· 24 다음