using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Schema;
namespaceswitch语句2 { internalclassProgram { staticvoidMain(string[] args) { int a = Convert.ToInt32(Console.ReadLine()); //定义一个整数 int b = Convert.ToInt32(Console.ReadLine()); int c = Convert.ToInt32(Console.ReadLine()); int d = Convert.ToInt32(Console.ReadLine());
int max = a, min = a; //赋值 if (max < b) { max = b; } if (max < c) { max = c; } if (max < d) { max = d; } if (min > b) { min = b; } if (min > c) { min = c; } if (min > d) { min = d; } Console.WriteLine("最大的值{0},最小的值{1}.", max, min); } }