三个数的最大值

来源:互联网 发布:淘宝侵权怎么处理 编辑:程序博客网 时间:2024/05/18 01:00
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{    class Program    {        static void Main(string[] args)        {            int a, b, c;            Console.WriteLine("请输入三个整数:");            a = int.Parse(Console.ReadLine());            b = int.Parse(Console.ReadLine());            c = int.Parse(Console.ReadLine());            int max1;            max1 = a > b ? a : b;            int max2 = a > c ? a : c;            int max = max1 > max2 ? max1 : max2;            Console.WriteLine("三个数的最大值是:"+max);            Console.ReadKey();        }    }}

0 0
原创粉丝点击