日期:2014-05-17 浏览次数:20884 次
static void Main(string[] args)
{
int[] arr = new int[] { 1, -3, 9, 4, 2, 5, 1, -4, 0 };
print(arr);
}
private static void print(params int[] integers)
{
bubbleSort(integers);
find(integers, 0, integers.Length - 1);
}
private static void find(int[] integers, int begin, int end)
{
int sum = 5;
for (int i = begin; i < end; i++)
{
int v = integers[i];
int j = end;//integers.Length - 1;
int b = integers[j];
if (i > 0 && v == integers[i - 1])
continue;
if (v + b < sum)
continue;
else if (v + b == sum)
{
ok(v, b);
if (j - 1 <= i + 1)
continue;
&nbs