Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Threading;
- namespace ConsoleTesting3
- {
- class ConsoleTesting3
- {
- private static void Main()
- {
- Console.Write("Enter integers, separated by space: ");
- var kozle = ReadInput();
- Console.WriteLine("Largest: {0}", GetMax(kozle));
- Console.WriteLine();
- PrintCredits();
- Console.ReadKey();
- }
- private static void PrintCredits()
- {
- string name = "Svetlozar Valentinov Kirkov";
- foreach (var znak in name)
- {
- Console.Write(znak);
- Thread.Sleep(90);
- }
- Console.WriteLine();
- }
- private static int[] ReadInput(params int[] inputLine)
- {
- string[] input = Console.ReadLine().Split(' ');
- int[] result = new int[input.Length];
- for (int i = 0; i < result.Length; i++)
- {
- result[i] = Convert.ToInt32(input[i]);
- }
- return result;
- }
- static int GetMax(params int[] nums)
- {
- int maximal = nums[0];
- for (int i = 1; i < nums.Length; i++)
- {
- if (nums[i] > maximal)
- {
- maximal = nums[i];
- }
- }
- return maximal;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment