Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- for (char a = 'B'; a <= 'L'; a += 2) {
- for (char b = 'f'; b >= 'a'; b--) {
- for (char c = 'A'; c <= 'C'; c++) {
- for (int d = 1; d <= 10; d++) {
- for (int e = 10; e > 0; e--) {
- if (--n == 0) {
- System.out.printf("Ticket combination: %c%c%c%d%d\n", a, b, c, d, e);
- System.out.println("Prize: " + (a + b + c + d + e) + " lv.");
- return;
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement