Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- namespace TypeCasting
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
- string letterLastSector = Console.ReadLine();
- char ch = letterLastSector.ToCharArray()[0];
- int countRowsFirstSector = int.Parse(Console.ReadLine());
- int seatsCountOnOddRow = int.Parse(Console.ReadLine());
- int totalSeatsCount = 0;
- int x = 1;
- for (int i = 'A'; i <= ch; i++)
- {
- for (int j = 1; j < countRowsFirstSector + x; j++) // rows
- {
- if (j % 2 == 1)
- {
- for (int k = 'a' ; k < 'a' + seatsCountOnOddRow; k++)
- {
- Console.WriteLine($"{(char)i}{j}{(char)k}");
- totalSeatsCount++;
- }
- }
- else
- {
- for (int k = 'a'; k < 'a' + seatsCountOnOddRow + 2; k++)
- {
- Console.WriteLine($"{(char)i}{j}{(char)k}");
- totalSeatsCount++;
- }
- }
- }
- x++;
- }
- Console.WriteLine(totalSeatsCount);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement