Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#2 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#3 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#4 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#5 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#6 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#7 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#8 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#9 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#10 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#11 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
||
#12 |
Error de compilación
Main.java:1: error: class mayorX is public, should be declared in a file named mayorX.java public class mayorX { ^ Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class mayorX 3 errors |
public class mayorX { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String palabra = ""; char[] letras; int repetir = 0; System.out.println("Escribe una frase: "); palabra = sc.nextLine(); letras = palabra.toCharArray(); for (int i = 0; i < letras.length; i++) { char letraActual = letras[i]; int cont = 0; System.out.println(letraActual); for(int j = 0; j < letras.length; j++) { if(letras[j] == letraActual) cont++; } if(repetir < cont) { repetir = cont; } } if (repetir !=1) { System.out.println("yes"); }else { System.out.println("no"); } } }