zoukankan      html  css  js  c++  java
  • 结对项目编程-四则运算

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

    }

     

    运行结果:

     

    总结:

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

  • 相关阅读:
    CSS color
    Python 集成开发环境(IDE)
    Flexible and Economical UTF-8 Decoder
    方程式组织EQUATION DRUG平台解析(提纲) —方程式组织系列分析报告之四
    Windows Server 2008 IE 无法调整安全级别
    蟑螂数据库
    MySQL OCP
    TCP协议疑难杂症全景解析
    数据库资源博客---小麦苗BEST
    C++并发实战 与多线程
  • 原文地址:https://www.cnblogs.com/blog-ghy/p/5373157.html
Copyright © 2011-2022 走看看