Using System;
Using System. Collections. Generic;
Using System. Text;
Using System. Collections;
Namespace MyLunch
{
/// <Summary>
/// Switch usage
/// </Summary>
///
Public class Number
{
ArrayList list = new ArrayList ();
Int [] intList;
Public Number ()
{
}
Public void Input ()
{
Console. WriteLine ("This program allows you to enter three numbers and then sort them out in order. (Exit by X )");
String Input;
For (;;)
{
Input = Console. ReadLine ();
If ("X" = Input. ToUpper ())
Break;
Else
List. Add (Input );
}
}
Public void Sort ()
{
IntList = new int [list. Count];
Console. WriteLine (list. Count );
// Value.
For (int I = 0; I <list. Count; I ++)
{
IntList [I] = int. Parse (list [I]. ToString ());
}
For (int I = 0; I <intList. Length; I ++)
{
For (int j = I + 1; j <intList. Length; 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)
{
Console. WriteLine (item. ToString ());
}
}
}
Class Program
{
Static void Main (string [] args)
{
Number number = new Number ();
Number. Input ();
Number. Sort ();
Number. Display ();
}
}
}
// Another example. They are simple.
Using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Text;
Namespace ConsoleApplication1
{
Class Program
{
Static void Main (string [] args)
{
Console. WriteLine ("welcome to this mall" + "" + "how much have you spent today? ");
Int input = int. Parse (Console. ReadLine ()));
String Display;
If (input <5)
{
Display = "you can leave now! ";
}
Else if (input> 5 & input <20)
{
Display = "reward you for a cup of coffee! ";
}
Else if (input> 20 & input <30)
&