SHOW:
|
|
- or go back to the newest paste.
1 | import java.util.Scanner; | |
2 | import java.util.Arrays; | |
3 | ||
4 | public class minimumNum{ | |
5 | public static void main(String[] args) { | |
6 | Scanner s = new Scanner(System.in); | |
7 | System.out.println("How many numbers do you want to check?"); | |
8 | int n = s.nextInt(); | |
9 | int[] num = new int[n]; | |
10 | System.out.println("Type your numbers below:"); | |
11 | for(int i = 0; i < n; i++){ | |
12 | num[i] = s.nextInt(); | |
13 | } | |
14 | Arrays.sort(num); | |
15 | - | System.out.println("The minimum is "num[0]); |
15 | + | System.out.println("The minimum is " + num[0]); |
16 | } | |
17 | } |