Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class WeddingSeats
- {
- static void Main(string[] args)
- {
- char lastSector = char.Parse(Console.ReadLine());
- int rowsInSector = int.Parse(Console.ReadLine());
- int seatsInOddRows = int.Parse(Console.ReadLine());
- int seatsInEvenRows = seatsInOddRows + 2;
- int count = 0;
- for (char sector = 'A'; sector <= lastSector; sector++)
- {
- for (int row = 1; row <= rowsInSector; row++)
- {
- int seatsInCurrentRow;
- if (row % 2 != 0)
- {
- seatsInCurrentRow = seatsInOddRows;
- }
- else
- {
- seatsInCurrentRow = seatsInEvenRows;
- }
- for (char seat = 'a'; seat <= 'a' + seatsInCurrentRow - 1; seat++)
- {
- Console.WriteLine($"{sector}{row}{seat}");
- count++;
- }
- }
- rowsInSector++;
- }
- Console.WriteLine(count);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement