silvana1303

movie tickets

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