Advertisement
aggressiveviking

Untitled

Feb 25th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _06.MovieTickets
  4. {
  5.     class MovieTickets
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int a1 = int.Parse(Console.ReadLine());
  10.             int a2 = int.Parse(Console.ReadLine());
  11.             int n = int.Parse(Console.ReadLine());
  12.  
  13.             int m = (n / 2) - 1;
  14.  
  15.             for (char i = (char)a1; i <= (a2 - 1); i++)
  16.             {
  17.                 for (int j = 1; j <= (n - 1); j++)
  18.                 {
  19.                     for (int k = 1; k <= m; k++)
  20.                     {
  21.                         int sum = j + k + i;
  22.  
  23.                         if (i % 2 == 1 && sum % 2 == 1)
  24.                         {
  25.                             Console.WriteLine($"{i}-{j}{k}{(int)i}");
  26.                         }
  27.                     }
  28.                 }
  29.             }
  30.  
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement