Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Homemeworke
- {
- public static void main (String[] bruh)
- {
- System.out.print("How many numbers: ");
- int num = IO.readInt();
- double array[] = new double[num];
- for (int j = 0; j < num; j++) {
- System.out.printf("Please enter double %d:%n", j + 1);
- array[j] = IO.readDouble();
- System.out.println("unsorted array: " + Arrays.toString(array));
- Arrays.sort(array); // <-- or however you want to sort the array.
- System.out.println("sorted array: " + Arrays.toString(array));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement