自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

静下心来做事

可理性一旦产生,即便用感情的泪水将它淹没,它仍在水下岿然不动地保存。

  • 博客(32)
  • 资源 (1)
  • 收藏
  • 关注

原创 CSAPP AttackLab解题记录

作业地址: http://csapp.cs.cmu.edu/3e/labs.htmlAttackLab共5道题,Phase1~Phase3是缓冲区溢出(Buffer Overflow)攻击,Phase4~Phase5是返回导向(ROP:Return Oriented Programming)攻击。各题解题思路:Phase1: 任务: 通过缓冲区溢出来修改函数getbuf的返回地址,使得getbuf返回之后跳转到函数touch1执行。 第一题,说详细一点。...

2021-02-13 14:36:02 1017

原创 CSAPP Bomb Lab phase6 解题记录

最近下班无聊的时候把CSAPP Bomb Lab做完了(Bomb Lab作业地址: http://csapp.cs.cmu.edu/3e/labs.html)写一下最难的phase6的解题记录:phase_6的反汇编代码如下:Dump of assembler code for function phase_6: 0x00000000004010f4 <+0>: push %r14 0x00000000004010f6 <+2>: push %r1

2021-01-17 16:36:08 1172 2

原创 64位Win10系统上nbtstat命令执行失败原因

在64位Windows系统下,有两个系统目录:C:\Windows\system32 和 C:\Windows\SysWOW64。C:\Windows\system32目录下存放的是64位的程序,而C:\Windows\SysWOW64目录下存放的是32位的程序。如果在一个32位的应用程序内执行脚本内的系统指令时,Windows系统会自动重定向到存放32位系统程序的系统目录(也就是C:\Windows\SysWOW64目录)下查找系统指令对应的程序(exe文件等)。 如果没有找到对应的可执...

2020-12-15 13:36:13 1464

原创 MFC中结构体CFileStatus的m_attribute成员取值及含义

//结构体CFileStatus的成员及含义struct CFileStatus{ CTime m_ctime; // creation date/time of file CTime m_mtime; // last modification date/time of file CTime m_atime; // last access date/time of file LONG m_size; // log...

2020-09-05 10:04:44 397

原创 LeetCode21. Merge Two Sorted List

两个有序链表的合并Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1->3-&g...

2020-02-23 17:32:48 110

原创 枚举法求解四大湖问题

今天突然想起来以前有个四大湖的问自己一直没做出来,蛮长时间了。正好拎出来做一做。直接暴力枚举法:#include <iostream>using namespace std;int main(){ int DT, HZ, PY, TH; for(DT=1; DT<=4;DT++) { for(HZ=1;HZ<=4;HZ++) { for...

2020-02-21 14:47:18 794

原创 PAT 1075 PAT Judge

1075 PAT Judge (25 分)The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.Input Specificati...

2019-01-24 22:21:54 312

原创 PAT 1073 Scientific Notation

Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]+E[+-][0-9]+ which means that the inte...

2019-01-19 12:52:10 169

原创 PAT1032 Sharing

To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For example,...

2018-08-30 16:52:02 195

转载 Linux向文件添加内容的几种方法

转载自博客园:https://www.cnblogs.com/ZGreMount/p/7645542.html例如,要想test.txt文件添加内容"I am a boy",test.txt在当前目录中方法一:vi编辑法  打开终端,输入vi test.txt 回车,按a或i进入编辑模式,输入 I am a boy,然后按esc键退出编辑模式,输入:wq保存并退出。 方法二:e...

2018-08-20 23:06:26 73509

原创 PAT1022 Digital Library

A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number a...

2018-07-27 19:31:41 151

原创 PAT1071 Speech Patterns

People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down a speaker...

2018-07-26 20:11:36 422

原创 PAT1054 The Dominant Color

Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the d...

2018-07-25 15:44:59 155

原创 C++ map容器按value值排序

思路:将map的key值和value值分别放在pair类型的vector中,构造比较函数cmp:bool cmp(const pair&lt;string,int&gt; &amp;p1, const pair&lt;string,int&gt; &amp;p2) { return p1.second &gt; p2.second;}假设已有一组map&lt;string,in...

2018-07-25 15:14:26 5065

原创 PAT1100 Mars Numbers

People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, ...

2018-07-25 12:17:36 163

原创 PAT1063 Set Similarity

题目Given two sets of integers, the similarity of the sets is defined to be N~c~/N~t~*100%, where N~c~ is the number of distinct common numbers shared by the two sets, and N~t~ is the total number of ...

2018-07-24 00:36:46 142

转载 C++中的string常用函数用法

转自http://www.cnblogs.com/Draymonder/p/6944479.html标准c++中string类函数介绍 注意不是CString之所以抛弃char*的字符串而选用C++标准程序库中的string类,是因为他和前者比较起来,不必 担心内存是否足够、字符串长度等等,而且作为一个类出现,他集成的操作函数足以完成我们大多数情况下(甚至是100%)的需要。我们可以用 = 进行赋...

2018-05-19 19:53:23 309

原创 matlab符号运算与数值运算的转化

例如:syms x aM = a*x^2 + 5; %符号运算结果a=3;x=2;subs(M) %数值运算结果

2018-05-18 21:37:37 15645 1

转载 C++中memset函数

转载自  http://blog.sina.com.cn/s/blog_6f611c300101e59l.htmlvoid * memset (void * S, int value, size_t num);函数作用:将ptr所指向的某一块内存中的每个字节的内容全部设置为value指定的ASCII值,块的大小由第三个参数指定,这个函数通常为新申请的内存做初始化工作,其返回值为指向S的指针。注意它...

2018-05-16 23:06:14 2896 1

转载 中国大学MOOC-陈越、何钦铭-数据结构-10-排序6 Sort with Swap(0, i)

转载自http://blog.sina.com.cn/s/blog_ce1b01420102visv.htmlGiven any permutation of the numbers {0, 1, 2,..., N-1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operatio...

2018-05-07 17:25:48 245

原创 计数排序 C++代码

#include &lt;iostream&gt;#include &lt;vector&gt;#include &lt;string&gt;#include &lt;algorithm&gt; //计数排序 using namespace std;int GetMax(int a[],int n){ int max=a[0]; for(int i=1;i&lt;n;...

2018-04-29 09:43:05 1031

转载 经典C++笔试题目100例,接近实际,值得一看!

第一部分:C++与C语言的差异(1-18)1、C 和 C++ 中 struct 有什么区别? Protection行为 能否定义函数 C 无 否,但可以有函数指针 C++ 有 可以,默认是public 2、C++中的 struct 和 class 有什么区别?【参考答案】从语法上讲,class和struct做类型定义时只有两点区别:...

2018-04-25 18:43:56 124425 26

原创 中国大学慕课-数据结构(浙江大学)课后练习-02-线性结构2 一元多项式的乘法与加法运算

02-线性结构2 一元多项式的乘法与加法运算(20 分)设计函数分别求两个一元多项式的乘积与和。输入格式:输入分2行,每行分别先给出多项式非零项的个数,再以指数递降方式输入一个多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。输出格式:输出分2行,分别以指数递降方式输出乘积多项式以及和多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。零多项式应输出0 0。...

2018-04-23 19:50:45 477

转载 C++ 中vector的使用方法

转自阿里云云栖社区点击打开链接摘要: 在c++中vector是一个十分有用的容器。 作用它能够像容器一样存放各种类型的对象简单地说vector是一个能够存放任意类型的动态数组能够增加和压缩数据。 vector在C++标准模板库中的部分内容它是一个多功能的能够操作多种数据结构和算法的模板类和函数库。在c++中vector是一个十分有用的容器。作用它能够像容器一样存放各种类型的对象简单地说vector...

2018-04-16 09:56:02 257

原创 PTA 自测5

自测-5 Shuffling MachineShuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees co...

2018-04-12 22:04:06 177

原创 PTA 自测2

自测-2 素数对猜想(20 分)让我们定义d​n​​为:d​n​​=p​n+1​​−p​n​​,其中p​i​​是第i个素数。显然有d​1​​=1,且对于n&gt;1有d​n​​是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。现给定任意正整数N(&lt;10​5​​),请计算不超过N的满足猜想的素数对的个数。输入格式:输入在一行给出正整数N。输出格式:在一行中输出不超过N的满足猜想的素...

2018-04-09 21:53:59 210

原创 PTA 自测1

自测-1 打印沙漏(20 分)本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印***** *** * ********所谓“沙漏形状”,是指每行输出奇数个符号;各行符号中心对齐;相邻两行符号数差2;符号数先从大到小顺序递减到1,再从小到大顺序递增;首尾符号数相等。给定任意N个符号,不一定能正好组成一个沙漏。要求打印出的沙漏能用掉尽可能多的符号。输...

2018-04-09 20:13:29 436

原创 PAT A 1015 Reversible Primes Solved by C

#include &lt;stdio.h&gt;#include &lt;math.h&gt;#include &lt;stdlib.h&gt;int Determine(int m);int main(){ int i,j,radix,num,flag,k,m; int A[100]= {0}; while(1) { scanf("%d"...

2018-04-05 14:23:53 102

原创 PAT A 1007 Maximum Subsequence Sum Solved By C

#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;int main(){ int N,i,A[10002]; int count=0; scanf("%d",&amp;N); for(i=0; i&lt;N; i++) { scanf("%d",&amp;A[i]); } ...

2018-03-28 20:09:18 124

原创 PAT A 1001 A+B Format

#include &lt;stdio.h&gt;#include &lt;math.h&gt;#define N 100int main(){ int a,b,c,k,i=0,j,tag=0; int A[N],B[N]; scanf("%d %d",&amp;a,&amp;b); c=a+b; if(c==0) { prin...

2018-03-27 23:08:08 134

原创 PAT A 1009 Product of Polynomials

#include &lt;stdio.h&gt;#include &lt;stdlib.h&gt;int main(){ int a,i,j,m,n; scanf("%d",&amp;a); int A1[a]; double A2[a]; for(i=0; i&lt;a; i++) { scanf("%d %lf",&amp;...

2018-03-27 22:26:55 118

原创 PAT甲级1008题(Elevator)

#include &lt;stdio.h&gt;#include &lt;math.h&gt;int main(){ int N,i,j; int sum=0; int a[100]; scanf("%d",&amp;N); sum+=5*N; for(i=0; i&lt;N; i++) { scanf("%d",&am...

2018-03-25 15:45:25 341 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除