Guest User

Untitled

a guest
Jan 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. import java.util. InputMismatchException;
  2. import java.util.Scanner;
  3. public class numerito{
  4.     public static void main (String[] agrs){
  5.         Scanner C = new Scanner(System.in);
  6.         int N;
  7.         boolean sigue = true;
  8.         while (sigue) {
  9.             try {
  10.                 System.out.print("Numero ? ");
  11.                 N = C.nextInt();
  12.                 System.out.println("Su numero: "+N);
  13.                 sigue = false;
  14.             }
  15.             catch (InputMismatchException in) {
  16.                 System.out.println("debe ingresar solo numeros enteros!! ");
  17.                 C.nextLine();
  18.             }
  19.        }
  20.     }
  21. }
Add Comment
Please, Sign In to add comment