1 public class Random200_300 { 2 public static void main(String[] args) { 3 int r1 = 0; 4 while (true) { 5 r1 = (int)(Math.random() * 10) * 10 + 200; 6 if ((200 <= r1) && (r1 < 300)) { 7 System.out.println(r1); 8 } else { 9 System.out.println("Error!"); 10 break; 11 } 12 13 try { 14 Thread.sleep(200); 15 } catch (InterruptedException e) { 16 e.printStackTrace(); 17 } 18 } 19 } 20 }