有Bug版本:
using System;
using System.Collections.Generic;
using System.Text;
namespace 取最大值
{
class Program
{
static void Main(string[] args)
{
//不断用户输入一个数字(假定用户输入的为正整数),当用户输入"end"时显示刚才输入的数字中最大的值
int max = 0; //用来存放最大的值
while (true) //让程序死循环运算
{
Console.WriteLine("请输入一个数字,结束(end)");
string s = Console.ReadLine();
if (s == "end") //先判断输入的值是否等于end,如果是,则输出存放在max中的值
{
&