Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _6___Ticket_Combination
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numberComibation = int.Parse(Console.ReadLine());
- int countCombinations = 0;
- for (char stadium = 'B'; stadium <= 'L'; stadium ++)
- {
- if(stadium %2 !=0)
- {
- continue;
- }
- for (char sector = 'f'; sector >= 'a'; sector --)
- {
- for (char entrance = 'A';entrance <= 'C';entrance ++)
- {
- for (int row= 1; row <=10; row++)
- {
- for (int seat = 10; seat >= 1; seat--)
- {
- countCombinations++;
- if (countCombinations==numberComibation)
- {
- Console.WriteLine($"Ticket combination: {stadium}{sector}{entrance}{row}{seat}");
- int sum = stadium + sector + entrance + row + seat;
- Console.WriteLine($"Prize: {sum} lv.");
- }
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement