Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1.  
  2. package ikerprim;
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class ikerprim
  7. {
  8.  
  9.  
  10.     public static void main(String[] args)
  11.     {
  12.         Scanner s=new Scanner(System.in);
  13.         int a,b,c;
  14.         System.out.println("Írj be 3 számot!");
  15.           do {
  16.               System.out.println("1. szám:");
  17.             a = s.nextInt();
  18.               System.out.println("2. szám:");
  19.             b = s.nextInt();
  20.               System.out.println("3. szám:");
  21.             c = s.nextInt();
  22.               if (c>Math.max(a,b)||c<Math.min(a,b)) {
  23.                   System.out.println("Elbasztad, írj be megint 3 számot!");
  24.               }
  25.         } while (c>Math.max(a,b)||c<Math.min(a,b));
  26.         System.out.println("sikeresen beírtál 3 számot!");
  27.     }
  28.    
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement