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