/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package listaexercicios;

/**
 *
 * @author awolf
 */
public class Questao24 {

    public static void main(String[] args) {
        int n = Entrada.leiaInt("Quantos números gerar");
        int vetorDados[] = new int[n];
        for (int i = 0; i < n; i++) {
            vetorDados[i] = (int) (Math.random() * 100);
        }
        
        // Burro sort (ordena desordenando tudo)
        // poucos ajustes melhora MUITO o desempenho
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if(vetorDados[i] < vetorDados[j]){ // swap
                    int aux = vetorDados[i]; 
                    vetorDados[i] = vetorDados[j];
                    vetorDados[j] = aux;
                }
            }
        }
        
        for (int i = 0; i < n; i++) {
            System.out.println(vetorDados[i]);            
        }

    }
}
