int a[13] = {};
for (int i = 0; i < 13; i++) {
a[i] = arc4random() % 31 + 70;
printf("%d ", a[i]);
}
BOOL needNextStep = YES;
for (int i = 0; i < 12 && needNextStep; i++) {
needNextStep = NO;
for (int j = 0; j < 12 - i; j++) {
int temp;
if (a[j] < a[j + 1]) {
needNextStep = YES;
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}
}
}
printf("\n");
for (int i = 0; i < 13; i++) {
printf("%d ", a[i]);
}
for (int i = 0; i < 13; i++) {
a[i] = arc4random() % 31 + 70;
printf("%d ", a[i]);
}
BOOL needNextStep = YES;
for (int i = 0; i < 12 && needNextStep; i++) {
needNextStep = NO;
for (int j = 0; j < 12 - i; j++) {
int temp;
if (a[j] < a[j + 1]) {
needNextStep = YES;
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}
}
}
printf("\n");
for (int i = 0; i < 13; i++) {
printf("%d ", a[i]);
}