namespace lx1
{
class Program
{
private static void Test(***)
{
for(int i=1;i<strArray.Length;i++)
{
Console.Write(strArray[i]+" ");
}
Console.WriteLine();
}
static void Main(string[] args)
{
Test("One", "Two", "Three");
Test("First", "Second", "Third", "Forth");
}
}
params string[] strArray
#include <iostream>
#include <stdio.h>
using namespace std;
int a[10] = { 2,3,4,1,2,3,1,2,1,5 };
int b[10];
void merge(int a[], int b[], int z, int m, int y) {
int i = z;
int j = m + 1;
int k = z;
int q;
while (i <= m && j <= y)
if (a[i] < a[j])
b[k++] = a[i++];
else
b[k++] = a[j++];
if (i <= m)
for (q = i; q <= m; q++)
b[k++] = a[i++];
else
for (q = j; q <= y; q++)
b[k++] = a[j++];
}
void copy(int a[], int b[], int l, int r)
{
int i;
for (i = l; i <= r; i++)
a[i] = b[i];
}
void sort(int a[], int l, int r)
{
if (l < r)
{
int m = (l + r) / 2;
sort(a, l, m);
sort(a, m + 1, r);
merge(a, b, l, m, r);
copy(a, b, l, r);
}
}
int main() {
sort(a, 0, 9);
for (int i = 0; i < 10; i++)
cout<<("%d", a[i]);
}