전체 글 (187) 썸네일형 리스트형 [자바] 정올 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)); } } [자바] 정올 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); } } 이전 1 ··· 11 12 13 14 15 16 17 ··· 24 다음