Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * The sample for input and output and sort numbers.
- * Author: Eddy^CZ 2018
- */
- using System;
- namespace LowesNumber
- {
- class UserInput
- {
- public int InputNumber = 0;
- public void AskForNumber(out int Output)
- {
- InputNumber++;
- Console.WriteLine(String.Format("Please value for number: {0}",InputNumber));
- string Input = Console.ReadLine();
- int.TryParse(Input,out Output);
- }
- }
- class Program
- {
- static readonly string ProgramName = "The number sorter : Eddy^CZ 2018\n";
- static void Main(string[] args)
- {
- Console.Title = ProgramName;
- Console.WriteLine(ProgramName);
- Console.ForegroundColor = ConsoleColor.Cyan;
- var UiInput = new UserInput();
- int[] RequiredNumbers = new int[3];
- for(int i = 0; i < RequiredNumbers.Length;i++)
- {
- UiInput.AskForNumber(out RequiredNumbers[i]);
- }
- Array.Sort(RequiredNumbers);
- Console.WriteLine("Your sorted numbers is here: \n\n");
- for (int j = 0; j < RequiredNumbers.Length; j++)
- {
- Console.WriteLine(RequiredNumbers[j]);
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement