Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CryptoCS
- {
- class Program
- {
- static void Main()
- {
- string value = Console.ReadLine();
- if (value == "int")
- {
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- Console.WriteLine(Math.Max(a, b));
- }
- else if (value == "char")
- {
- char c = char.Parse(Console.ReadLine());
- char d = char.Parse(Console.ReadLine());
- Console.WriteLine(Convert.ToChar(Math.Max(c, d)));
- }
- else if (value == "string")
- {
- string g = Console.ReadLine();
- string h = Console.ReadLine();
- int gNumber = 0;
- int hNumber = 0;
- foreach (char c in g)
- {
- gNumber += c;
- }
- foreach (char c in h)
- {
- hNumber += c;
- }
- if (gNumber > hNumber)
- {
- Console.WriteLine(g);
- }
- else
- {
- Console.WriteLine(h);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement