Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import java.util.*;
  2. public class Stammashu
  3. {
  4.  
  5. /**
  6. * @param args
  7. */
  8. public static void main(String[] args)
  9. {
  10. Random dice = new Random();
  11. int Random;
  12. int age;
  13. int age2;
  14. Random = 1+dice.nextInt(9999);
  15.  
  16. for(int counter=1; counter<=1;counter++){
  17. age = dice.nextInt(1);
  18. Scanner reader = new Scanner(System.in);
  19. System.out.println("Write the number: " + Random);
  20. age2 = reader.nextInt();
  21.  
  22. if (Random == age2)
  23. {
  24. System.out.println("Correct!");
  25. }
  26. else
  27. {
  28. System.out.println("Wrong");
  29. }
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement