任务描述
本关任务:编写一个程序,实现从键盘输入的三个整数,输出三个整数的最大值。
编程要求
根据提示,在右侧编辑器补充代码,计算并输出从键盘输入的三个数的最大值。
测试说明
平台会对你编写的代码进行测试:
测试输入:
4
91
7
预期输出:
最大值:91
测试输入:
151
100
75
预期输出:
最大值:151
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ch403
{
class Program
{
static void Main(string[] args)
{
/******begin*******/
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int c = int.Parse(Console.ReadLine());
if(b>a){
int max = b;
b = a;
a = max;
}
if(b>c){
int max = b;
b = c;
c = max;
}
if(a>c){
int max = a;
a = c;
c = max;
}
Console.WriteLine("最大值:{0}",+c);
/*******end********/
}
}
}