Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Reflection.Metadata.Ecma335;
- namespace Greater_of_Two_Values2
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- string value1 = Console.ReadLine();
- string value2 = Console.ReadLine();
- string value3 = Console.ReadLine();
- GetMax(value1, value2, value3);
- }
- static void GetMax(string value1, char value2, char value3)
- {
- if (value1 == "char")
- {
- if (Convert.ToChar(value2) > Convert.ToChar(value3))
- {
- Console.WriteLine(value2);
- }
- else
- {
- Console.WriteLine(value3);
- }
- }
- }
- static void GetMax(string value1, int value2, int value3)
- {
- if (value1 == "int")
- {
- if (Convert.ToInt16(value2) > Convert.ToInt16(value3))
- {
- Console.WriteLine(value2);
- }
- else
- {
- Console.WriteLine(value3);
- }
- }
- }
- static void GetMax(string value1, string value2, string value3)
- {
- if (value1 == "string")
- {
- if (value2 == value3)
- {
- Console.WriteLine(value2);
- }
- else
- {
- Console.WriteLine(value3);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement