분류 전체보기 (392) 썸네일형 리스트형 524 : 연산자 - 자가진단7 Java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); boolean bool1 = (num1 != 0) && (num2 != 0); boolean bool2 = (num1 != 0) || (num2 != 0); System.out.printf("%b %b", bool1, bool2); } } Colored by Color Scripter cs 523 : 연산자 - 자가진단6 Java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); System.out.printf("%d > %d --- %b\n", num1, num2, num1 > num2 ? true : false); System.out.printf("%d = %d --- %b\n", num1, num2, num1 >= num2 ? true : false); System.out.printf("%d 522 : 연산자 - 자가진단5 Java 1 2 3 4 5 6 7 8 9 10 11 12 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); System.out.println(num1 == num2 ? true : false); System.out.println(num1 != num2 ? true : false); } } Colored by Color Scripter cs 521 : 연산자 - 자가진단4 Java 1 2 3 4 5 6 7 8 9 10 11 12 13 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); int num3 = (num1++) * (--num2); System.out.printf("%d %d %d", num1, num2, num3); } } Colored by Color Scripter cs 520 : 연산자 - 자가진단3 Java 1 2 3 4 5 6 7 8 9 10 11 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++); System.out.println(++num); } } Colored by Color Scripter cs 519 : 연산자 - 자가진단2 Java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); num1 += 100; num2 %= 10; System.out.printf("%d %d", num1, num2); } } Colored by Color Scripter cs 518 : 연산자 - 자가진단1 Java 1 2 3 4 5 6 7 8 9 10 11 12 13 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); int num3 = sc.nextInt(); System.out.printf("sum : %d\n", num1+num2+num3); System.out.printf("avg : %d", (num1+num2+num3)/3); } } Colored by Color Scripter cs 110 : 입력 - 형성평가5 Java 1 2 3 4 5 6 7 8 9 10 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("yard? "); double num = sc.nextDouble(); System.out.printf("%.1fyard = %.1fcm", num, num*91.44); } } Colored by Color Scripter cs 109 : 입력 - 형성평가4 Java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); int num3 = sc.nextInt(); int sum = num1 + num2 + num3; double avg = sum/3; System.out.printf("sum = %d\n", sum); System.out.printf("avg = %.0f", avg); } } Colored by Color Scripter cs 108 : 입력 - 형성평가3 Java 1 2 3 4 5 6 7 8 9 public class Main { public static void main(String[] args) { double num1 = 100.12; int num2 = 50; double sum = num1 * (double)num2; System.out.printf("%.2f * %d = %.0f", num1, num2, sum); } } Colored by Color Scripter cs 107 : 입력 - 형성평가2 Java 1 2 3 4 5 6 7 8 9 public class Main { public static void main(String[] args) { double num1 = 80.50; double num2 = 22.34; double sum = num1+num2; System.out.printf("%10.2f%10.2f%10.2f", num1, num2, sum); } } Colored by Color Scripter cs [백준] 10817번 : 세 수 - java 1234567891011121314151617181920212223242526272829import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); int num3 = sc.nextInt(); int temp = 0; if(num2 이전 1 ··· 16 17 18 19 20 21 22 ··· 33 다음