SHARE
TWEET

07. Building - Lab

miroslav8705 Nov 22nd, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top