aggressiveviking

Untitled

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