兄弟初学c#有个问题想请教各位高手

来源:百度知道 编辑:UC知道 时间:2024/06/30 12:16:11
有会编:输入一组数,完成下列题目:
(1) 请你快速地找出最大数及其位置;
(2) 按从小到大排序;
在windows环境下编,有会的没

我首先要说一下,这个问题是很简单得数据结构的问题,不管是用什么语言,都有通用的原始方法办到。LZ应该自己去试着写写这个问题。那我现在使用C#语言来写,使用了这个语言提供好方法,取得最大值,定位,排序。
控制台程序,VS2008编译通过
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KongZhiTai
{
class Program
{
static void Main(string[] args)
{
int[] ArryIntBuff=new int[100];//缓存100个
bool Ent = false;//回车标志
bool Exit = false;//结束标志
string buff;//输入的字符串
int Index = 0;//记录输入了几个数
Console.WriteLine("输入数字,按回车输入,连按2次回车退出");
for (int i = 0; i < 100;i++ )
{
buff = Console.ReadLine();
if (buff.Length == 0)
{
if (Ent)
{
Exit = true;
}
else