#import <Foundation/Foundation.h>
void sorting(NSMutableArray *array, NSMutableArray *array2)
{
NSUInteger i = 0, k = 0, temp = 0;
for ( id obj in array ) {
if (obj>=array2[0])
k = i, temp = 1;
if (!temp)
k = 0;
for (i=array.count; i>=k; i--) {
array[i+1] = array;
array[k] = array2[0];
NSLog(@"%@", array2[0]);
}
}
}
int main(int argc, const char * argv[])
{
NSMutableArray *array = [NSMutableArray arrayWithObjects:@1, @3, @5, @7, @9, nil];
NSMutableArray *array2 = [NSMutableArray arrayWithObjects:@8, nil];
sorting(array, array2);
//NSLog(@"%@", array2[0]);
return 0;
}
帮忙看一下吧 不知道改哪里
|