挺有意思的,解一下试试 2014年5月19日16:32:29
01.01
0 | 0 |
33 | -33 |
1 | -1 |
public class Program { public static int Puzzle(int x) { return 0-x;//结果与x相加为0 } }
01.02
0 | -2 |
33 | 31 |
1 | -1 |
public class Program { public static int Puzzle(int x) { return x-2;//结果比x小2 } }
01.03
0 | 0 |
33 | 1089 |
1 | 1 |
public class Program { public static int Puzzle(int x) { return x*x;//结果为x的平方 } }
01.04
0 | 0 |
33 | 99 |
1 | 3 |
public class Program { public static int Puzzle(int x) { return x*3; } }
01.05
0 | 0 |
33 | 11 |
1 | 0 |
public class Program { public static int Puzzle(int x) { return x/3;//因为是int类型所以不够除的为0 } }
01.06
29 | 0 |
2 | 2 |
1 | 4 |
public class Program { public static int Puzzle(int x) { return 4/x;//x喂int类型 } }
01.07
1 | 1 | 0 |
2 | 2 | 0 |
public class Program { public static int Puzzle(int x, int y) { return x-y;//估计这个没写出来的一定是想难了 } }
01.08
29 | 33 | 95 |
1 | 1 | 3 |
public class Program { public static int Puzzle(int x, int y) { return y*2+x;//在29 33 得 95 可以看出 66 +29 } }
01.09
1 | 1 | 1 |
2 | 2 | 4 |
3 | 3 | 9 |
public class Program { public static int Puzzle(int x, int y) { return x*y;//x与y的积 } }
01.10
1 | 1 | 1 |
2 | 2 | 4 |
5 | 38 | 17 |
1 | 770 | 257 |
public class Program { public static int Puzzle(int x, int y) { return (3 * x + y) / 3;//很显然与上面的答案不同
/*这题在提示中默认值给了前两行比较不让人省心*/ } }
01.11
29 | 33 | 0 |
97 | 96 | 1 |
0 | 1 | 0 |
1 | 1 | 1 |
2 | 1 | 2 |
4 | -64 | 0 |
public class Program { public static int Puzzle(int x, int y) { return x/y;//就是因为是int类型的 } }
01.12
23 | 2 |
4 | 1 |
0 | 0 |
public class Program { public static int Puzzle(int x) { //23 2 //4 1 //0 0 return x%3; } }
01.13
23 | 3 |
4 | 2 |
0 | 1 |
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.
3 | 1 |
10 | 0 |
1 | 0 |
4 | 2 |
99 10
public class Program { public static int Puzzle(int x) { return 10%x; } }
01.15
44 | 33 | 48 | 41 |
0 | 0 | 0 | 0 |
public class Program { public static int Puzzle(int x, int y, int z) { return (x+y+z)/3; } }