- 博客(12)
- 收藏
- 关注
原创 Programming Languages, Part A Week2 作业(含 challenge questions)
Programming Languages, Part AWeek2 作业(含 challenge questions)(* 1 *)fun is_older (d1:int * int * int, d2:int * int * int) = if (#1 d1) <> (#1 d2) then (#1 d1) < (#1 d2) else if...
2020-04-02 12:31:45
269
原创 Coursera-Software-Security-week4-quiz
Week4 quizWhy is waiting to think about security until after the software is built a bad idea?You might make critical mistakes in the software’s designFixing problems once the software is built is ...
2020-03-16 02:17:19
2581
原创 Couresra—Software Security-week2 quiz
1.Question 1A program indexes a buffer after a pointer to that buffer has been used as a parameter to thefree() function. This isCorrect behaviorA violation of spatial memory safety*A violation of...
2020-03-15 14:47:13
4974
原创 Coursera-Software Security-week3 quiz
1.Question 1What is one difference between an HTTP GET and an HTTP POST request?Only GET requests are subject to the same-origin policy*Only POST requests may include parameter data in the request ...
2020-03-14 22:35:02
3306
原创 Coursera-Software-Security-Project1
Software Security Project1小白通过论坛自己理解的There is a stack-based overflow in the program. What is the name of the stack-allocated variable that contains the overflowed buffer?ans: wisConsider the b...
2020-03-12 04:02:25
3547
原创 Leetcode #2 Add Two Numbers(Python)超详细
Leetcode #2 Add Two Numbers题目描述You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit....
2020-02-23 04:39:50
538
原创 P1618 三连击(升级版)
P1618 三连击(升级版)类型:简单枚举(从123开始)注意点:处理 A B C,防止A B C 有相同因子最大值数学原理数能被A整除1.处理 A B C,防止A B C 有相同因子法一:辗转相除法写gcdint gcd(int a, int b){ return b == 0 ? a : gcd(b, a % b);}法二:c++库函数 __gcd#includ...
2019-11-13 08:08:36
347
原创 c++判断素数
判断素数6x 6x+1 6x+2 6x+3 6x+4 6x+5 中只有 6x+1 和 6x+5 不能被2 或3 整除6x+1 和 6x+5 也可表示为 6x +/- 1代码bool judge(int x){ if(x<=3) return x>1 ? 1:0;//判断小于等于三的特殊情况 if(x%6!=5 && x%6!=1) return 0;//排除...
2019-11-13 07:02:14
385
原创 find a way to escape题解
Find a way to escape题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1593题目描述: 一日,话说0068与***泛舟湖上。忽见岸边出现他的一大敌人elnil。0068当然不想落入elnil的魔爪,于是他就得想办法逃脱。这个湖是一个很规则的圆形,半径为R。此时0068正好在圆心位置。小船在湖中的速度为 V1,006...
2019-11-13 00:41:37
403
转载 C++ operator
operator是C++的关键字,它和运算符一起使用,表示一个运算符函数,理解时应将operator=整体上视为一个函数名。 这是C++扩展运算符功能的方法,虽然样子古怪,但也可以...
2019-10-29 01:37:03
5706
2
转载 C++ incline 内联函数
(转载)C++ incline 内联函数1.引入最大值函数int max(int a, int b){return a>b? a:b;}函数:方便调用缺点:调用函数比求解等价表达式要慢得多。在大多数的机器上,调用函数都要做很多工作:调用前要先保存寄存器,并在返回时恢复,复制实参,程序还必须转向一个新位置执行2.内联函数是什么C++中支持内联函数,其目的是为了提高函数的执行...
2019-10-28 02:00:59
1811
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人