微软Code Hunt答案(00-05)——沉迷娱乐的我

         昨天看到微软出的网游Code Hunt。o(∩_∩)o...哈哈,还不好好玩一吧,个人感觉不是一个模块比一个模块难的,Code Hunt是按功能划分。所以不要怕自己做不来,因为不同人特长不一样。像ACM都是分工合作的啦。废话不多,我们来总结一下前01-04的答案。希望对大家有帮助,纯属娱乐。还有很多可以优化的地方,欢迎一起来讨论!

         注:语言C# 网页地址:https://www.codehunt.com/

                转载请著明:http://blog.csdn.net/grublinux/article/details/26380131

     

注:澄清一些误会,下面的答案不是全部三星。有一些是还有优化余地的,为了免得误会我把能优化的题目用红色标注。然后如果大家提供了自己更加完美的答案,我会陆续更新上来,并且标注作者。谢谢大家,玩的开心!

chapter 00

00.02

using System;
public class Program {
    public static int Puzzle(int x) {
        return x+1;
    }
}

00.03

using System;
public class Program {
    public static int Puzzle(int x) {
        return 2*x;
    }
}

00.04

public class Program {
    public static int Puzzle(int x, int y) {
        return x+y;
    }
}

chapter 01

01.01

using System;
public class Program {
    public static int Puzzle(int x) {
        return (-1)*x;
    }
}

01.02

using System;
public class Program {
    public static int Puzzle(int x) {
        return x-2;
    }
}

01.03

using System;
public class Program {
    public static int Puzzle(int x) {
        return x*x;
    }
}

01.04

using System;
public class Program {
    public static int Puzzle(int x) {
        return 3*x;
    }
}

01.05

using System;
public class Program {
    public static int Puzzle(int x) {
        return x/3;
    }
}

01.06

using System;
public class Program {
    public static int Puzzle(int x) {
        return 4/x;
    }
}

01.07

using System;
public class Program {
    public static int Puzzle(int x, int y) {
        return x-y;
    }
}

01.08

using System;
public class Program {
    public static int Puzzle(int x, int y) { 
        return x+2*y;
    }
}

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 57
    评论
评论 57
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值