Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
Main.java:5: error: invalid method declaration; return type required public static Main(String[] args) { ^ 1 error |
||
#2 |
Error de compilación
Main.java:5: error: invalid method declaration; return type required public static Main(String[] args) { ^ 1 error |
||
#3 |
Error de compilación
Main.java:5: error: invalid method declaration; return type required public static Main(String[] args) { ^ 1 error |
||
#4 |
Error de compilación
Main.java:5: error: invalid method declaration; return type required public static Main(String[] args) { ^ 1 error |
||
#5 |
Error de compilación
Main.java:5: error: invalid method declaration; return type required public static Main(String[] args) { ^ 1 error |
||
#6 |
Error de compilación
Main.java:5: error: invalid method declaration; return type required public static Main(String[] args) { ^ 1 error |
||
#7 |
Error de compilación
Main.java:5: error: invalid method declaration; return type required public static Main(String[] args) { ^ 1 error |
||
#8 |
Error de compilación
Main.java:5: error: invalid method declaration; return type required public static Main(String[] args) { ^ 1 error |
||
#9 |
Error de compilación
Main.java:5: error: invalid method declaration; return type required public static Main(String[] args) { ^ 1 error |
||
#10 |
Error de compilación
Main.java:5: error: invalid method declaration; return type required public static Main(String[] args) { ^ 1 error |
import java.util.Scanner; public class contar_mayoresx { public static Main(String[] args) { Scanner sc = new Scanner(System.in); int tamano = sc.nextInt(); int cont1 = 0; int cont2 = 0; int cont3 = 0; int[] v = new int[tamano]; for (int i = 0; i < v.length; i++) { v[i] = sc.nextInt(); } for (int i = 0; i < v.length; i++) { if (v[i] > 0) { cont1++; } } System.out.println(cont1); for (int i = 0; i < v.length; i++) { if (v[i] > 1) { cont2++; } } System.out.println(cont2); for (int i = 0; i < v.length; i++) { if (v[i] > 4) { cont3++; } } System.out.println(cont3); } }