all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,16 @@
void bubble_sort(int *a, int n) {
int j, t = 1;
while (n-- && t)
for (j = t = 0; j < n; j++) {
if (a[j] <= a[j + 1]) continue;
t = a[j], a[j] = a[j + 1], a[j + 1] = t;
t=1;
}
}
int main(void) {
int a[] = {4, 65, 2, -31, 0, 99, 2, 83, 782, 1};
bubble_sort(a, sizeof(a) / sizeof(a[0]));
return 0;
}