/*
 * 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 Questao30 {

    public static double buscaMaior(double vetor[]) {
        double maior = vetor[0];
        for (int i = 1; i < vetor.length; i++) {
            if (vetor[i] > maior) {
                maior = vetor[i];
            }
        }
        return maior;
    }

    public static void main(String[] args) {
        double vetNumeros[] = new double[100];
        for (int i = 0; i < 100; i++) {
            vetNumeros[i] = Math.random() * 1000 + 1;
        }

        double maior = buscaMaior(vetNumeros);
        System.out.println(maior);
    }

}
