Using System; public class Test { public static void Main() { int a, b, c, d, min1, min2, max; Console.Write("a = "); a = int.Parse(Console.ReadLine()); Console.Write("b = "); b = int.Parse(Console.ReadLine()); Console.Write("c = "); c = int.Parse(Console.ReadLine()); Console.Write("d = "); d = int.Parse(Console.ReadLine()); if (a < b) min1 = a; else min1 = b; if (c < d) min2 = c; else min2 = d; if (min1 > min2) max = min1; else max = min2; Console.WriteLine("max = {0}", max); System.Console.ReadKey(); } }
public class Test
{
public static void Main()
{
int a, b, c, d, min1, min2, max;
Console.Write("a = ");
a = int.Parse(Console.ReadLine());
Console.Write("b = ");
b = int.Parse(Console.ReadLine());
Console.Write("c = ");
c = int.Parse(Console.ReadLine());
Console.Write("d = ");
d = int.Parse(Console.ReadLine());
if (a < b) min1 = a; else min1 = b;
if (c < d) min2 = c; else min2 = d;
if (min1 > min2) max = min1; else max = min2;
Console.WriteLine("max = {0}", max);
System.Console.ReadKey();
}
}