Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class TicketCombination {
- public static void main(String[] args) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- int ticketCombination = Integer.parseInt(reader.readLine());
- int counter = 0;
- for (char i = 'B'; i <= 'L'; i += 2) {
- for (char j = 'f'; j >= 'a'; j--) {
- for (char k = 'A'; k <= 'C'; k++) {
- for (int l = 1; l <= 10; l++) {
- for (int m = 10; m >= 1; m--) {
- counter++;
- if (counter == ticketCombination) {
- System.out.println("Ticket combination: " + i + j + k + l + m);
- System.out.println("Prize: " + (i + j + k + l + m) + "lv.");
- return;
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement