/*
 * 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 Questao33 {

    public static boolean buscaVetor(int vetor[], int numero) {
        boolean achou = false;
        for (int i = 0; i < vetor.length; i++) {
            if (vetor[i] == numero) {
                achou = true;
                //break;
            }
        }

        return achou;
    }

    public static void main(String[] args) {
        int vetor[] = {10, 23, 12, 45, 1, 5, 7, 0};

        boolean resp = buscaVetor(vetor, 4);
        // if(buscaVetor(vetor, 4)) {
        if (resp) {
            System.out.println("Achou");
        } else {
            System.out.println("Não achou");
        }
    }
}
