import java.util.Scanner;
/*
* 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.
*/
/**
*
* @author hp
*/
public class Ejercicio_4_1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner Leer = new Scanner(System.in);
int numeros[], N, numero, countAux = 0, numAux, i;
System.out.print("Ingrese la cant. de numeros a procesar: ");
N = Leer.nextInt();
numeros = new int[N];
for (i = 0; i < N; i++) {
System.out.print("Ingrese un numero: ");
numero = Leer.nextInt();
numeros[i] = numero;
}
System.out.print("Ingrese el numero que quiere buscar: ");
numAux = Leer.nextInt();
for (i = 0; i < N; i++) {
if (numAux == numeros[i] ) {
countAux += 1;
}
}
System.out.println("El numero " + numAux + " se repitio " + countAux + " veces");
}
}
Comentarios sobre la versión: v. 0.0.1 (0)
No hay comentarios