标签:stop cts within hint nslog rate top number ble
NSMutableArray *mArray = [NSMutableArray arrayWithObjects:@4,@5,@9,@2,@3,@3,@2,@7, nil];
for (int i = 0; i<mArray.count-1; i++) {
for (int j = 0; j<mArray.count - i-1; j++) {
if (mArray[i] < mArray[i+1]) {
NSInteger temp = [mArray[i+1]integerValue];
mArray[i+1] = mArray[i];
mArray[i] = [NSNumber numberWithInteger:temp];
}
}
}
for (int i = 0; i<mArray.count-1; i++) {
for (int j = 0; j<mArray.count - i-1; j++) {
if (mArray[j] < mArray[j+1]) {
NSInteger temp = [mArray[j+1]integerValue];
mArray[j+1] = mArray[j];
mArray[j] = [NSNumber numberWithInteger:temp];
}
}
}
for (int i = 0; i<mArray.count-1; i++) {
for (int j = i; j<mArray.count-1; j++) {
if (mArray[j]<mArray[j+1]) {
NSInteger temp = [mArray[j+1]integerValue];
mArray[j+1] = mArray[j];
mArray[j] = [NSNumber numberWithInteger:temp];
}
}
}
for (int i = 0; i<mArray.count-1; i++) {
for (int j = i; j<mArray.count-1; j++) {
if (mArray[i]<mArray[j+1]) {
NSInteger temp = [mArray[j+1]integerValue];
mArray[j+1] = mArray[i];
mArray[i] = [NSNumber numberWithInteger:temp];
}
}
}
[mArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSLog(@"value %@",obj);
}];
标签:stop cts within hint nslog rate top number ble
原文地址:https://www.cnblogs.com/guligei/p/9473511.html