【垃圾菜鸟不务正业】Code Hunt编程游戏01.*

挺有意思的,解一下试试 2014年5月19日16:32:29

01.01  

00
33-33
1-1

public class Program {
    public static int Puzzle(int x) {
        return 0-x;//结果与x相加为0
    }
}
01.02

0-2
3331
1-1

public class Program {
    public static int Puzzle(int x) {
        return x-2;//结果比x小2
    }
}
01.03

00
331089
11

public class Program {
    public static int Puzzle(int x) {
		
        return x*x;//结果为x的平方
    }
}
01.04

00
3399
13

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

00
3311
10

public class Program {
    public static int Puzzle(int x) {
        return x/3;//因为是int类型所以不够除的为0
    }
}
01.06

290
22
14

public class Program {
    public static int Puzzle(int x) {
        return 4/x;//x喂int类型
    }
}
01.07

110
220
   

public class Program {
    public static int Puzzle(int x, int y) {
        return x-y;//估计这个没写出来的一定是想难了
    }
}
01.08

293395
113
   

public class Program {
    public static int Puzzle(int x, int y) { 
        return y*2+x;//在29 33  得 95 可以看出 66 +29 
    }
}
01.09

111
224
339

public class Program {
    public static int Puzzle(int x, int y) {
        return x*y;//x与y的积
    }
}
01.10

111
224
53817
1770257

public class Program {
    public static int Puzzle(int x, int y) {
        return  (3 * x + y) / 3;//很显然与上面的答案不同
/*这题在提示中默认值给了前两行比较不让人省心*/
    }
}
01.11

29330
97961
010
111
212
4-640

public class Program {
    public static int Puzzle(int x, int y) { 
        return x/y;//就是因为是int类型的
    }
}
01.12

232
41
00

public class Program {
    public static int Puzzle(int x) {
		//23    2
		//4	1
		//0	0
        return x%3;
    }
}
01.13  
233
42
01
public class Program {
    public static int Puzzle(int x) {
        return x%3+1;//与上面完全是一道题
    }
}
01.14     You will have to use the modulo % operator to solve this one.
31
100
10
42
99 10
public class Program {
    public static int Puzzle(int x) {
        return 10%x;
    }
}
01.15
44334841
0000
    
public class Program {
    public static int Puzzle(int x, int y, int z) {
        return (x+y+z)/3;
    }
}




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值