Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace ConsoleApp6
- {
- class Program
- {
- static void Main(string[] args)
- {
- int ticketsCount = int.Parse(Console.ReadLine());
- for(int i = 0;i < ticketsCount; i++)
- {
- string ticket = Console.ReadLine();
- char one = ticket[0];
- char two = ticket[1];
- char three = ticket[2];
- char four = ticket[3];
- bool conditon = one >= 'A' && one <= 'Z';
- if (ticket.Length == 4) {
- if (conditon)
- {
- Console.WriteLine($"Seat decoded: {one}{two}{three}");
- }
- else
- {
- Console.WriteLine($"Seat decoded: {four}{two}{three}");
- }
- }
- else if (ticket.Length == 5 || ticket.Length == 6)
- {
- var asciidigit = (int)two;
- Console.WriteLine($"Seat decoded: {one}{asciidigit}");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement