/*★ C# Sort X,Y,Z Function Program 前田 稔 ★*/
using System;
class Prog
{
public static void Main()
{
int a= 5;
int b= 1;
int c= 3;
sort(ref a, ref b, ref c);
Console.WriteLine("{0} {1} {2}", a, b, c);
}
static void sort(ref int x, ref int y, ref int z)
{
int wk;
if (x>y)
{ wk= x; x= y; y= wk; }
if (x>z)
{ wk= x; x= z; z= wk; }
if (y>z)
{ wk= y; y= z; z= wk; }
}
}
|
>CD C:\Data\C#\BAT\Prog1 >CSC Sortxyz.cs >Sortxyz.exe 1 3 5 |
![]()