using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
/*
* 不断的输入数字,知道输入end,输出最大值
*/
static void Main(string[] args)
{
int max = 0;
while(true)
{
Console.WriteLine("请输入数字:");
string number = Console.ReadLine();
if("end" == number)
{
Console.WriteLine("{0}", max);
Console.ReadKey();
return;
}
int numberInt = Convert.ToInt32(number);
if(numberInt > max)
{
max = numberInt;
}
}
Console.ReadKey();
}
}
}
不断的输入数字,直到输入end,输出最大值
最新推荐文章于 2021-09-13 13:01:06 发布