-
CSAPP Bomb Lab V.2016.01.12
$ ./bomb inputs.txt Welcome to my fiendish little bomb. You have 6 phases with which to blow yourself up. Have a nice day! Phase 1 defused. How about the next one? That's number 2. Keep going! Halfway there! So you got that one. Try this one. Good work! On to the next... Curses, you've found the secret phase! But finding it and solving it are quite different... Wow! You've defused the secret stage! Congratulations! You've defused the bomb!
-
怎么用
FoldRight
实现FoldLeft
呢?两个函数的签名如下def foldLeft[A,B]: (List[A], B) => ((B, A) => B) => B def foldRight[A,B]: (List[A], B) => ((A, B) => B) => B
-
CSAPP Data Lab V.2016.05.04。
$ ./btest Score Rating Errors Function 1 1 0 bitAnd 2 2 0 getByte 3 3 0 logicalShift 4 4 0 bitCount 4 4 0 bang 1 1 0 tmin 2 2 0 fitsBits 2 2 0 divpwr2 2 2 0 negate 3 3 0 isPositive 3 3 0 isLessOrEqual 4 4 0 ilog2 2 2 0 float_neg 4 4 0 float_i2f 4 4 0 float_twice Total points: 41/41
-
斐波拉契数列,即形如
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89...
,通项公式为An = An-1 + An-2
的数列。那么怎么用递归的方式求出指定位置的斐波拉契数呢?
-
之前一直以为Python中
and
、or
这两个表达式的返回值是True
或者False
,今早帮同学解答问题时才发现之前的理解是错误的。
-
想要运行一个Java程序需要经过三个阶段:编写源代码—编译—在JVM上运行。那么一个字符串在以上三个阶段的编码方式是怎样的呢?另外,如果Java程序中要输出字符串,那么输出的字符串的编码又是什么呢?