프로그래밍 (122) 썸네일형 리스트형 [자바] 정올 111 : 연산자 - 형성평가1 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(); int sum = a+b+c+d; System.out.println("sum " + sum); System.out.println("avg " + (sum/4)); } } [자바] 정올 525 : 연산자 - 자가진단8 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(); int max = a > b ? a : b; max = max > c ? max : c; System.out.println((max == a && (max != b || max != c)) + " " + (a==b && b==c)); } } [자바] 정올 524 : 연산자 - 자가진단7 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(); boolean c = (a !=0 ), d = (b != 0 ); System.out.print( (c && d) + " " + (c || d)); } } [자바] 정올 523 : 연산자 - 자가진단6 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)); System.out.println(a +" < "+ b + " --- " + (a=b)); System.out.println(a +" [자바] 정올 522 : 연산자 - 자가진단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(); System.out.println(a == b ? 1 : 0); System.out.println(a == b ? 0 : 1); } } [자바] 정올 521 :연산자 - 자가진단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(); int mul = a++ * --b; System.out.println(a+ " " + b + " " + mul); } } [자바] 정올 520 : 연산자 - 자가진단3 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); System.out.println(a++); System.out.println(++a); } } [자바] 정올 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 이전 1 ··· 7 8 9 10 11 12 13 ··· 16 다음