七星彩票选号

来源:互联网 发布:php 输出html代码 编辑:程序博客网 时间:2024/04/27 16:12
七星彩票随机选号即随机选出7个0-9的号
import java.util.Scanner;  /**  * 七星彩票选号 *   * @李贤 *  */  public class Xuanhao {      public static void main(String[] args) {          Scanner sc = new Scanner(System.in);          System.out.print("请输入你要购买的注数:");          if (sc.hasNextInt()) {              int i = sc.nextInt();              if (i > 0) {                  for (int j = 1; j <= i; j++) {                      String a = "第" + j + "注的选号为:";                      for (int k = 1; k <= 7; k++) {                          a += (int) (Math.random() * 10) + " ";                      }                      System.out.println(a);                  }              } else {                  System.out.println("输入有误!!!");              }          }         sc.close();      }  } 

0 0
原创粉丝点击