Created
September 2, 2013 14:03
-
-
Save gusthavosouza/6413232 to your computer and use it in GitHub Desktop.
Imprimir numeros do array em ordem crescente.
utilizando sort.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.util.Arrays; | |
public class Crescente { | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
Arrays crescente = null; | |
long[] arr = new long[4]; | |
for (int i = 0; i < arr.length; i++) { | |
arr[i] = scan.nextLong(); | |
} | |
for (int a = 0; a < arr.length; a++) { | |
crescente.sort(arr); | |
System.out.println(arr[a]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment