Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Two_dimensional_array
- {
- class TwoDimentionalArray
- {
- static void Main(string[] args)
- {
- int[,] numberApartments = {{400, 401, 402, 403},
- {300, 301, 302, 303},
- {200, 201, 202, 203},
- {100, 101, 102, 103}};
- int floor, apartments;
- string inputString;
- Console.Write("Enter the floor on which you live: ");
- inputString = Console.ReadLine();
- floor = Convert.ToInt32(inputString);
- Console.Write("Enter the number of apartament you want to be checked: ");
- inputString = Console.ReadLine();
- apartments = Convert.ToInt32(inputString);
- Console.WriteLine("The apartment when you think that is your husband is \n{0}", numberApartments[floor,apartments]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement