Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
And, Yes, I am still in love with her. Especially, the last weeks this feeling of being in love has been growing stronger again.
But spiritually, I have been feeling well. Especially, reading parts of Keys to the Song of Solomon, by Lambert Dolphin, has made me feeling closer to God.
If a stack runs downward, and you have a procedure having a local string buffer (and that is often the case), and if the procedure does not check against buffer overflows, you can overwrite the return address on the run-time stack. Such a hole can be used to call a system procedure. If the run-time stack grows upward, this can never happen.
void main() { int n500 = 0, n250 = 0, n100 = 0, n25 = 0, n10 = 0, n5 = 0, a = 500, m = 0; while (a >= 0) { while (a >= 0) { while (a >= 0) { while (a >= 0) { while (a >= 0) { m++; n10++; a -= 10; } a += 10 * n10; n10 = 0; n25++; a -= 25; } a += 25 * n25; n25 = 0; n100++; a -= 100; } a += 100 * n100; n100 = 0; n250++; a -= 250; } a += 250 * n250; n250 = 0; n500++; a -= 500; } printf("Number of combinations is %d\n", m); }
void main() { int m[100][5]; int i,j; int v[] = { 2, 5, 20, 50, 100 }; for (i = 0; i < 100; i++) for (j = 0; j < 5; j++) m[i][j] = 0; for(i = 0; i <=500; i++) for (j = 0; j < 5; j++) m[i%100][j] = (j == 0 ? 1 : m[i%100][j-1]) + m[(i + 100 - v[j])%100][j]; printf("Number of combinations is %d\n", m[500%100][4]); }The answer is that these programs both print the value of
c(500, {5, 10, 25, 100, 250, 500})
,
where the function c
is defined as follows:
c(a : posint, {v_1, .. , v_n} : P posint) = count({ { (v_1, c_1), .. , (v_n, c_n) } : P (posint, posint) | v_1 * c_1 + .. + v_n * c_n = a })(more)