import UIKit UIKit import AppDelegate import SecondTask int main int a

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#import "SecondTask.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
SecondTask *object = [[SecondTask alloc] init];
object.firstArray = [NSMutableArray arrayWithObjects:@9, @7, @11, @10, @5, @0, nil];
object.secondArray = [NSMutableArray arrayWithObjects:@(-1), @(-1), @(-1), @(-1), @(-1), @(-1), nil];
for (int i = 0; i < object.firstArray.count; i++) {
if (object.firstArray[i] > object.maximumValue) {
object.maximumValue =object.firstArray[i];
object.indexOfMaximumValue = i;
}
}
for (int i = 0; i < (object.firstArray.count - 1); i++) {
[object searchForMaximumValue];
object.secondArray[object.indexOfPreviousMaximumValue] = [NSNumber numberWithInteger: object.indexOfMaximumValue];
}
[object searchForMaximumValue];
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}