最主要的依旧是区分“?:”的对应关系!
比谁最大:
namespace ConsoleApplication4 { class Program { static void Main(string[] args) { while (true) { double a, b, c; a = Convert.ToDouble(Console.ReadLine()); b = Convert.ToDouble(Console.ReadLine()); c = Convert.ToDouble(Console.ReadLine()); Console.WriteLine(a > b ? (a > c ? a + "最大" : c + "最大") : (b > c ? b + "最大" : c + "最大")); } } } }