代码如下:
import javax.swing.*; public class Java_2 { public static void main(String[] args) { //*********Found********** String input = ____________________.showInputDialog("你想抽几位数?"); //*********Found********** int k = Integer.parseInt(______________________); input = JOptionPane.showInputDialog("你想在自然数中抽的最高数是几?"); //*********Found********** int n = ___________________.parseInt(input); int lotteryOdds = 1; for (int i = 1; i <= k; i++) { lotteryOdds = lotteryOdds * (n - i + 1) / i; } //*********Found********** System.out.println("你中奖的几率是1/" + ____________ + ". Good luck!"); System.exit(0); } }