자바페스티벌29 N과 X를 입력 받아 N개의 숫자 중 X보다 작은 수만 출력하기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 package 자바페스티벌2; import java.util.Scanner; public class ex09 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("N 입력 >> "); int n = sc.nextInt(); System.out.print("X 입력 >> "); int x = sc.nextInt(); int[] arr = new int[n]; for (int i = 1; i 2023. 1. 23. 2차원 배열을 왼쪽으로 90도 회전하여 출력 하시오 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 package 자바페스티벌2; public class ex08 { public static void main(String[] args) { int[][] a = new int[5][5]; int cnt = 1; for (int i = 0; i 2023. 1. 23. 5개의 정수를 입력 받아 오름차순 정렬하여 출력하는 프로그램을 구현하시오. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 package 자바페스티벌2; import java.util.Arrays; import java.util.Scanner; public class ex07 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] a = new int[5]; for (int i = 0; i a[j]) { } else { chk = j; } } int cmp = a[a.length - i - 1]; a[a.length - i - 1] = a[chk]; a[chk] = cmp; .. 2023. 1. 23. 별찍기 오른쪽으로 출력하기 제껏이 모두 정답일 순 없지만 출력은 잘 되어서 코드 공유합니다 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 package 자바페스티벌2; public class ex06 { public static void main(String[] args) { for (int j = 0; j j; i--) { System.out.print(" "); } for (int i = 0; i 2023. 1. 23. 이전 1 2 3 다음 반응형