import java.util.Scanner;
public class Lottery {
public static void main(String[] args) {
int lottery = (int)(Math.random() * 100);//0~99
Scanner input = new Scanner(System.in);
System.out.println("Enter you lottery pick : ");
int guess = input.nextInt();
int lottteryDigit1 = lottery / 10;
int lottteryDigit2 = lottery % 10;
int guessDigit1 = guess / 10;
int guessDigit2 = guess % 10;
System.out.println("The lottery number is " + lottery);
if (guess == lottery)
System.out.println("Exact match: you win $10,000");
else if (guessDigit2 == lottteryDigit1 && guessDigit1 ==lottteryDigit2)
System.out.println("Match all digit: you win $3,000");
else if (guessDigit1 == lottteryDigit1 ||
guessDigit1 == lottteryDigit2 ||
guessDigit2 == lottteryDigit1 ||
guessDigit2 == lottteryDigit2)
System.out.println("Match one digit: you win $1,000");
else
System.out.println("Sorry, no match");
input.close();
}
}