Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace exam
- {
- class Program
- {
- static void Main(string[] args)
- {
- char last = char.Parse(Console.ReadLine());
- int seats = int.Parse(Console.ReadLine());
- char oddseats =char.Parse(Console.ReadLine());
- char c = Convert.ToChar(48 + oddseats);
- int sectorCount = 0;
- int seatsCount = 0;
- for(char a='A';a<=last;a++)
- {
- sectorCount++;
- if(sectorCount>1)
- {
- seats++;
- }
- for (int i = 1; i <= seats; i++)
- {
- if (i % 2 == 0)
- {
- for (char b = 'a'; b <=c+2; b++)
- {
- Console.WriteLine($"{a}{i}{b}");
- seatsCount++;
- }
- }
- else
- {
- for (char b = 'a'; b <= c; b++)
- {
- Console.WriteLine($"{a}{i}{b}");
- seatsCount++;
- }
- }
- }
- }
- Console.WriteLine(seatsCount);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment