using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication5
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string strNumber = "";
? ? ? ? ? ? int max = 0;
? ? ? ? ? ? while (strNumber != "end")
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine("請(qǐng)輸入一個(gè)數(shù)字行瑞,輸入end盖文,我們將顯示你輸入的數(shù)字中的最大值");
? ? ? ? ? ? ? ? strNumber = Console.ReadLine();
? ? ? ? ? ? ? ? if (strNumber != "end")
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? try
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? int number = Convert.ToInt32(strNumber);
? ? ? ? ? ? ? ? ? ? ? ? if (number > max)
? ? ? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? ? ? max = number;
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? catch
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("輸入有誤,請(qǐng)重新輸入");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.WriteLine("您剛才輸入的數(shù)字中最大值是{0}", max);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.ReadKey();
? ? ? ? }
? ? }
}