您的位置:首页 > 编程语言

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

2014-05-20 10:23 375 查看
挺有意思的,解一下试试 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;
    }
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: