본문 바로가기

728x90
반응형

프로그래밍

(122)
[자바] 정올 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); } }
[자바] 정올 113 : 연산자 - 형성평가4 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(); System.out.println(++a + " " + b--); System.out.println(a + " " + b); } }
[자바] 정올 113 : 연산자 - 형성평가3 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(); System.out.println("width = " + (a+5)); System.out.println("length = " + (b*2)); System.out.println("area = " + ((a+5)*(b*2))); } }
[자바] 정올 112 : 연산자 - 형성평가2 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(); System.out.println(a + " / " + b + " = "+ (a/b) +"..."+(a%b)); } }

728x90
반응형