namespace function __ Green song Race score
{
Class Program
{
Public int[] Array (int[] a)//Sort
{
int n = a.length;
for (int i = 1; I <= a.length; i++)
{
for (int j = 1; J <= A.length-i; j + +)
{
int temp = 0;
if (A[j-1]<a[j])
{
temp = a[j-1];
A[J-1] = A[j];
A[J] = temp;
}
}
}
return A;//Returns a int[] type of a, used to
}
static void Main (string[] args)
{
Console.WriteLine ("\t\t*********** under the judges to start grading ***********");
Int[] Pingweidafen=new int[5];
//input (right click--Refactor--Extract Method--Enter method name)
Shuru (Pingweidafen);
//Sort
Int[] b= new program (). Array (Pingweidafen);
//Output
Shuchu (b);
Console.ReadLine ();
}
private static void Shuchu (int[] b) //output result
{
for (int i = 0; i < 5; i++)
{
Console.WriteLine (B[i]);
}
}
private static void Shuru (int[] pingweidafen) //input Judges score
{
for (int i = 0; i < 5; i++)
{
Console.WriteLine ("Please" + (i + 1) + "judges Scoreboard:");
Pingweidafen[i] = Convert.ToInt32 (Console.ReadLine ());
}
}
}
}
Function Green Song score