Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace WeddingSeats
- {
- class Program
- {
- static void Main(string[] args)
- {
- char finalSector = char.Parse(Console.ReadLine());
- int rows = int.Parse(Console.ReadLine());
- int oddSeats = int.Parse(Console.ReadLine());
- int totalSeats = 0;
- for (char i = 'A'; i <= finalSector; i++)
- {
- for (int k = 1; k <= rows; k++)
- {
- int currentSeats = oddSeats;
- if (k % 2 == 0)
- {
- currentSeats += 2;
- }
- for (char o = 'a'; o < currentSeats + 97 ; o++)
- {
- Console.WriteLine($"{i}{k}{o}");
- totalSeats++;
- }
- }
- rows++;
- }
- Console.WriteLine(totalSeats);
- }
- }
- }
Add Comment
Please, Sign In to add comment