结对项目编程-四则运算

结对对象:黄佳明 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;

}

 

运行结果:

 

总结:

    在这次结对编程的过程中,我体会到了结对编程的力量,我们互相讨论,互相借鉴,得到了很大的提升!

 

转载于:https://www.cnblogs.com/blog-ghy/p/5373157.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值