No ma miralo:
package DelDia;
import java.util.*;
public class noNegativo {
static Scanner datos = new Scanner(System.in);
public static void main(String[] args) {
// TODO Auto-generated method stub
boolean isNotNegative = true;
while (isNotNegative){
System.out.println("Dame un numero: ");
int numero = datos.nextInt();
if (numero < 0){
isNotNegative = false;
break;
}else{
if (numero < 10){
for (int i=1; i<=10; i++){
System.out.println(i + " * " + numero + " = " + (numero*i));
}
}else{
System.out.print("El numero es mayor que 10, no se que hacer");
}
}
}
System.out.println("Fin del juego :P");
}
}
package DelDia;
import java.util.*;
public class noNegativo {
static Scanner datos = new Scanner(System.in);
public static void main(String[] args) {
// TODO Auto-generated method stub
boolean isNotNegative = true;
while (isNotNegative){
System.out.println("Dame un numero: ");
int numero = datos.nextInt();
if (numero < 0){
isNotNegative = false;
break;
}else{
if (numero < 10){
for (int i=1; i<=10; i++){
System.out.println(i + " * " + numero + " = " + (numero*i));
}
}else{
System.out.print("El numero es mayor que 10, no se que hacer");
}
}
}
System.out.println("Fin del juego :P");
}
}
No hay comentarios:
Publicar un comentario