结对对象:黄佳明 2013110416 博客地址:http://www.cnblogs.com/ezreal2016/
双方贡献比例:1:1
编程照片:
源代码:
//
// main.m
// ErZhu_test
//
// Created by 苟皓衍 on 16/3/15.
// Copyright © 2016年 苟皓衍. All rights reserved.
//
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
// insert code here...
int a = 0;
int b = 0;
int c = 0;
int d = 0;
NSArray *array1 = [[NSArray alloc] initWithObjects:@"+",@"-",@"*",@"%", nil];
for (int i = 0; i<30; i++) {
NSMutableArray *randomArray = [[NSMutableArray alloc] init];
a = arc4random() % 10;
b = arc4random() % 10;
c = arc4random() % 10;
d = arc4random() % 10;
while ([randomArray count] < 3) {
int k = arc4random() % [array1 count];
[randomArray addObject:[array1 objectAtIndex:k]];
}
NSLog(@"%d%@%d%@%d%@%d",a,[randomArray objectAtIndex:arc4random()%3],b,[randomArray objectAtIndex:arc4random()%3],c,[randomArray objectAtIndex:arc4random()%3],d);
}
}
return 0;
}
运行结果:
总结:
在这次结对编程的过程中,我体会到了结对编程的力量,我们互相讨论,互相借鉴,得到了很大的提升!