C#:求两个整数的最大值

任务描述

本关任务:编写一个程序,实现从键盘输入的两个整数,输出两个整数的最大值。

测试说明

平台会对你编写的代码进行测试:

测试输入:

4

91

预期输出:

最大值:91

测试输入:

151

100

预期输出:

最大值:151

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace ch402

{

    class Program

    {

        static void Main(string[] args)

        {

            /******begin*******/

            int a = int.Parse(Console.ReadLine());

            int b = int.Parse(Console.ReadLine());

            if(a>b){

                Console.WriteLine("最大值:{0}",+a);

            }

            else{

                Console.WriteLine("最大值:{0}",+b);

            }

            /*******end********/

        }

    }

}