Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp331
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- TestTheInputForInt(input);
- TestTheInputForChar(input);
- TestTheInputForString(input);
- }
- private static void TestTheInputForInt(string input)
- {
- if (input == "int")
- {
- int nomer1 = int.Parse(Console.ReadLine());
- int nomer2 = int.Parse(Console.ReadLine());
- int min = Math.Min(nomer1, nomer2);
- int max = Math.Max(nomer1, nomer2);
- Console.WriteLine(max);
- }
- }
- private static void TestTheInputForChar(string input)
- {
- if (input == "char")
- {
- char char1 = char.Parse(Console.ReadLine());
- char char2 = char.Parse(Console.ReadLine());
- if (char1 > char2)
- {
- Console.WriteLine(char1);
- }
- else
- {
- Console.WriteLine(char2);
- }
- }
- }
- private static void TestTheInputForString(string input)
- {
- if (input == "string")
- {
- string purvoIme = Console.ReadLine();
- string vtoroIme = Console.ReadLine();
- int duljinaNaString = purvoIme.Length;
- int duljinaNa2String = vtoroIme.Length;
- if (duljinaNaString > duljinaNa2String)
- {
- Console.WriteLine(purvoIme);
- }
- else
- {
- Console.WriteLine(vtoroIme);
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment