forked from txs72/JavaTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLottoNumbers.java
More file actions
executable file
·38 lines (36 loc) · 1.11 KB
/
LottoNumbers.java
File metadata and controls
executable file
·38 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* */ package ch07;
/* */
/* */ import java.util.Scanner;
/* */
/* */ public class LottoNumbers {
/* */ public static void main(String[] args) {
/* 7 */ Scanner input = new Scanner(System.in);
/* 8 */ boolean[] isCovered = new boolean[99];
/* */
/* */
/* 11 */ int number = input.nextInt();
/* 12 */ while (number != 0) {
/* 13 */ isCovered[number - 1] = true;
/* 14 */ number = input.nextInt();
/* */ }
/* */
/* */
/* 18 */ boolean allCovered = true;
/* 19 */ for (int i = 0; i < 99; i++) {
/* 20 */ if (!isCovered[i]) {
/* 21 */ allCovered = false;
/* */
/* */ break;
/* */ }
/* */ }
/* 26 */ if (allCovered) {
/* 27 */ System.out.println("The tickets cover all numbers");
/* */ } else {
/* 29 */ System.out.println("The tickets don't cover all numbers");
/* */ }
/* */ }
/* */ }
/* Location: /Volumes/TXS.128G/hope useful/practice/2020.jar!/ch07/LottoNumbers.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/