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 }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-09-10
  • 2021-05-29
  • 2022-12-23
  • 2021-07-29
  • 2022-12-23
猜你喜欢
  • 2021-06-12
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
相关资源
相似解决方案