Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. package ejercicio7;
  2. import java.util.*;
  3. /**
  4. *
  5. * @author Usuario
  6. */
  7. public class Ejercicio7 {
  8.  
  9. /**
  10. * @param args the command line arguments
  11. */
  12. public static void main(String[] args) {
  13. // TODO code application logic here
  14. Scanner tecla=new Scanner (System.in);
  15. int asd[]= new int[100];
  16. int meno=0, mayo=0, comp=0, i=0;
  17. for (i=1;i<=100;i++){
  18. System.out.println("Escriba el valor del numero: "+i);
  19. asd[i]= tecla.nextInt();
  20. if (asd[i]<15){
  21. meno++;
  22. }
  23. if (asd[i]>50){
  24. mayo++;
  25. }
  26. if (asd[i]>45 && asd[i]<50){
  27. comp++;
  28. }
  29. }
  30. System.out.println("La canidad de numero menores a 15 es:"+meno);
  31. System.out.println("La cantidad de numeros mayores es igual a: "+mayo);
  32. System.out.println("La cantidad de numeros que estan entr 45 y 55 son: "+comp);
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement