z3 巧解逆向题 题目下载链接:http://reversing.kr/download.php?n=7 这次实验的题目为Reversing.kr网站中的一道题目. 题目要求: ReversingKr KeygenMe Find the Name when the Serial is 76876-77776 This problem has several answers. Password is ***p 这是一道典型的用户名-序列号形式的题目,序列号已经给出,且用户名的最后一位为p. z3…
这里是杭电hdu上的链接:http://acm.hdu.edu.cn/showproblem.php?pid=3999 Problem Description: As we know,the shape of a binary search tree is greatly related to the order of keys we insert. To be precisely: 1. insert a key k to a empty tree, then the tree becom…
第五十一题 Write a C function which does the addition of two integers without using the '+' operator. You can use only the bitwise operators.(Remember the good old method of implementing the full-adder circuit using the or, and, xor gates....) 题目讲解: 参考:ht…
第四十六题 What does the following macro do? #define ROUNDUP(x,n) ((x+n-1)&(~(n-1))) 题目讲解: 参考:http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=814501 用于内存对齐,n为2的幂. 第四十七题 Most of the C programming books, give the following example for the definitio…
第三十八题 What is the bug in the following program? #include <stdlib.h> #include <stdio.h> #define SIZE 15 int main() { int *a, i; a = malloc(SIZE*sizeof(int)); ; i<SIZE; i++) *(a + i) = i * i; ; i<SIZE; i++) printf("%d\n", *a++);…
第三十四题 The following times. But you can notice that, it doesn't work. #include <stdio.h> int main() { int i; ; ; i < n; i-- ) printf("-"); ; } Well fixing the above code is straight-forward. To make the problem interesting, you have to f…
第三十一题 The following is a simple C program to read and print an integer. But it is not working properly. What is(are) the mistake(s)? #include <stdio.h> int main() { int n; printf("Enter a number:\n"); scanf("%d\n",n); printf(&quo…
第二十六题(不会) The following is a simple program which implements a minimal version of banner command available on most *nix systems. Find out the logic used in the program. #include<stdio.h> #include<ctype.h> char t[]={ ,,,,,,,,,, ,,,,,,,,,, ,,,,,…
第二十一题 What is the potential problem with the following C program? #include <stdio.h> int main() { ]; printf("Enter the string:"); scanf("%s",str); printf("You entered:%s\n",str); ; } 题目讲解: 易造成数组越界,scanf改成如下形式比较保险 scanf(…
第十六题 The following is a small C program split across files. What do you expect the output to be, when both of them compiled together and run? File1.c ]; File2.c extern int *arr; int main() { arr[] = ; ; } 题目讲解: 编译完运行发生段错. File1.c中声明的是个数组,File2.c中声明的是…
第九题 #include <stdio.h> int main() { float f=0.0f; int i; ;i<;i++) f = f + 0.1f; if(f == 1.0f) printf("f is 1.0 \n"); else printf("f is NOT 1.0\n"); ; } 知识点讲解: 浮点寄存器 浮点寄存器是FPU的组成部分.硬件架构不同,浮点寄存器的个数和位数也不同.X86架构的浮点寄存器有: 1)8个80位的数据…
# 1-->a 2-->b 3-->c 4-->d a[1]-->question1 a=[None]*11 #11是为了下标方便些,要不逻辑描述的时候容易出错 sum=[None]*4 for i in range(4**10): #定义循环次数 for j in range(1,11): #定义每个问题的答案 a[j]=int(i%(4**j)/(4**(j-1)))+1 for k in range(4): #计算每个选项的个数 sum[k]=a.count(k+1)…