Advertisement
YORDAN2347

Building

Dec 12th, 2020
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Building
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int floors = int.Parse(Console.ReadLine());
  10.             int apartments = int.Parse(Console.ReadLine());
  11.  
  12.             for(int i = floors; i >= 1; i--)
  13.             {
  14.                 for(int j = 0; j < apartments; j++)
  15.                 {
  16.                     if(i == floors )
  17.                        Console.Write($"L{i}{j} ");
  18.                     else
  19.                     {
  20.                         if(i % 2 == 1)
  21.                             Console.Write($"A{i}{j} ");
  22.                         else
  23.                             Console.Write($"O{i}{j} ");
  24.                     }                                    
  25.                 }
  26.                 Console.WriteLine();
  27.             }
  28.         }
  29.     }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement