Advertisement
Spocoman

Movie Tickets

Sep 8th, 2024
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int a1 = Integer.parseInt(scanner.nextLine()),
  7.                 a2 = Integer.parseInt(scanner.nextLine()),
  8.                 n = Integer.parseInt(scanner.nextLine());
  9.  
  10.         for (int i = a1; i < a2; i++) {
  11.             for (int x = 1; x < n; x++) {
  12.                 for (int y = 1; y < n / 2; y++) {
  13.                     if (i % 2 == 1 && (i + x + y) % 2 == 1) {
  14.                         System.out.println((char) i + "-" + x + y + i);
  15.                     }
  16.                 }
  17.             }
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement