Advertisement
miroslav8705

07. Building - Lab

Nov 22nd, 2019
1,018
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _07._Building
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int floorNumber = int.Parse(Console.ReadLine());
  10.             int flatNumber = int.Parse(Console.ReadLine());
  11.  
  12.             for (int floor = floorNumber; floor >= 1; floor--)
  13.             {
  14.                 for (int flat = 0; flat < flatNumber; flat++)
  15.                 {
  16.                     if (floor == floorNumber)
  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
Advertisement