-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx05.java
More file actions
39 lines (31 loc) · 809 Bytes
/
Ex05.java
File metadata and controls
39 lines (31 loc) · 809 Bytes
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
33
34
35
36
37
38
39
import java.util.Scanner;
import java.util.Arrays;
/**
*
* Ex 05 Cria um array que vai receber uma sequencia numerica de 10 inteiros,
* e ao final imprime a sequencia em ordem crescente
*
* @author eliwelton.moreira
*
*/
public class Ex05 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int i;
int[] numeros = new int[10];
System.out.println("Digite 10 números inteiros:");
for(i = 0; i < 10; i++){
numeros[i] = input.nextInt();
}
/**
* Sort Metodo que ordena os valores do array na ordem crescente
*
* @param numeros Array de inteiros com 10 posicoes
*/
Arrays.sort(numeros);
for(i = 0; i < 10; i++){
System.out.println(numeros[i]);
}
input.close();
}
}