정올 자바 585번1 [정올/JAVA] 585 : 함수2 - 자가진단7 import java.util.Scanner; public class Main {public static void bubble(int[] arr) {int temp;for (int i = 0; i < arr.length - 1; i++) {for (int j = 0; j < arr.length -1; j++) {if (arr[j] < arr[j + 1]) {temp = arr[j];arr[j] = arr[j + 1];arr[j + 1] = temp;}} for (int num = 0; num < arr.length; num++) {System.out.print(arr[num] + " ");}System.out.println();} } public static void main(String args[]) .. 2020. 7. 25. 이전 1 다음