冒泡排序
static int[] Bubble(int[] arr) { int temp=0; for (int i = 0; i < arr.Length -1; i++) { for (int j = i+1; j < arr.Length; j++) { if (arr[i]>arr[j]) { temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } } } return arr; }
递归
static int Foo(int i) { if (i <= 0) return 0; else if (i > 0 && i <= 2) return 1; else return Foo(i - 1) + Foo(i - 2); }