using System;
using SystemCollectionsGeneric;
using SystemText;
using SystemCollections;
namespace MyLunch
{
/// <summary>
/// switch的用法
/// </summary>
///
public class Number
{
ArrayList list = new ArrayList();
int[] intList;
public Number()
{
}
public void Input()
{
ConsoleWriteLine(这个程序是让你输入三个数然后再按照顺序排列出来(按X退出));
string Input;
for (; ; )
{
Input = ConsoleReadLine();
if (X == InputToUpper())
break;
else
listAdd(Input);
}
}
public void Sort()
{
intList = new int[listCount];
ConsoleWriteLine(listCount);
//附值
for (int i = ; i < listCount; i++)
{
intList[i] = intParse(list[i]ToString());
}
for (int i = ; i < intListLength; i++)
{
for (int j = i + ; j < intListLength; j++)
{
int temp;
if (intList[i] > intList[j])
{
temp = intList[j];
intList[j] = intList[i];
intList[i] = temp;
}
}
}
}
public void Display()
{
foreach (var item in intList)
{
ConsoleWriteLine(itemToString());
}
}
}
class Program
{
static void Main(string[] args)
{
Number number = new Number();
numberInput();
numberSort();
numberDisplay();
}
}
}
//另外一个例子都是蛮简单的
using System;
using SystemCollectionsGeneric;
using SystemLinq;
using SystemText;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
ConsoleWriteLine(欢迎光临本商场+\n+你今天花了多少钱啊?);
int input=intParse((ConsoleReadLine()));
string Display;
if (input<)
{
Display=你可以走了!;
}
else if(input>&&input<)
{
Display=奖励你一杯咖啡!;
}
else if(input>&&input<)
{
Display=送你五块钱;
}
else if(input>&&input<)
{
Display=你是疯子哇!;
}
else
{
Display=早点回去睡觉吧!;
}
ConsoleWriteLine(Display+\n再见!不送);
}
}
}