- 博客(12)
- 收藏
- 关注
原创 C c++11环境配置 与原版本并存
因为之前要学习c++ primer plus,突然要用到c++11的环境,所以最近都在配置。由于在服务器上还需要使用之前的c++旧版本,搞了很久,写下这篇希望能给大家带来帮助。Centos升级c11请看Lzpong的 写的相当详细,推荐https://www.cnblogs.com/lzpong/p/5755678.htmlLzpong一些小tips请先安装bzip2yum inst...
2018-10-28 10:45:50
622
原创 C++中的指针/引用/数组
C++的指针 引用 数组三者关系迁徙1. 指针和引用在C++中,我觉得指针和引用是很容易弄混的,大概是因为这两者真的太像了。声明一个引用和声明一个指针int a = 100;int &reference_a = a;int *pointer_a = &a;int *pointer = 100; 你就说这像不像,声明指针也要用到&,不过就是一个在左边,一个...
2018-10-28 10:32:39
817
原创 使用离散数学理解C++函数
使用离散数学理解C++函数举一个简单的例子int fac(int n){ int ret = 1; for(int i = 1; i < n; i++) sum *= i; return ret;}函数主要有返回类型,参数列表, 函数名,函数体函数其实就是离散数学中的映射,函数名就是函数名,返回类型其实是返回值所属的集合,...
2018-10-23 23:36:16
401
原创 Leetcode219_Contains_DuplicateII
题目Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is at mo...
2018-04-25 21:46:28
146
原创 Leetcode149_Max_Points_on_a_Line
题目Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Input: [[1,1],[2,2],[3,3]] Output: 3翻译就是给一组点,找到其中数量最多的都在一条直线上的点解答/** * Defini...
2018-04-24 20:18:03
157
原创 Leetcode 447. Number of Boomerangs
题目 Given n points in the plane that are all pairwise distinct, a “boomerang” is a tuple of points (i, j, k) such that the distance between i and j equals the distance between i and k (the order of...
2018-04-24 11:36:53
153
原创 Leetcode 49 Group Anagrams
Given an array of strings, group anagrams together.Example:Input: ["eat", "tea", "tan", "ate", "nat", "bat"],Output:[ ["ate","eat","tea"], ["nat"
2018-04-21 12:34:48
152
原创 关于string中=的
对string中的=,因为java和c++不同的关系,总是有点混乱java public static void main(String[] args) { String s1 = "aaabb"; String s2 = s1; if ( s1 == s2 ) System.out.println("SAME"...
2018-04-21 10:16:34
256
原创 c++中使用hash_map
using namespace __gnu_cxx;//在Linux需加入这一句c++中使用hash_map需要加上这一句
2018-04-21 09:01:45
464
转载 GPL和BSD
GPL和BSD许可证是开源社区最大的两个阵营,尽管都提倡开源、自由,但是两阵营相互不鸟,经常争论不休。根本上是因为两者对于代码的使用自由有着本质上的不同。GPL许可证的由来 1980,一个叫Richard Stallman的美国人因为无法容忍软件私有化,而建立了GPL许可证。他认为,软件的源代码是全人类的财富,应该允许程序员自由共享。 GPL许可证的核心含义是,允许任何人观看、修...
2018-03-07 17:17:52
566
翻译 linux中硬链接和软链接的区别
硬链接与软链接的区别在Linux的文件系统中,保存在磁盘分区中的文件不管是什么类型都给它分配一个编号,称为索引节点号inode 。软连接,其实就是新建立一个文件,这个文件就是专门用来指向别的文件的(那就和windows 下的快捷方式的那个文件有很接近的意味)。软链接产生的是一个新的文件,但这个文件的作用就是专门指向某个文件的,删了这个软连接文件,那就等于不需要这个连接,和原来的存在的实体原文件没有...
2018-03-05 13:34:37
301
原创 Clion MinGW windows C++环境搭建
Clion+MinGW,windows C++环境搭建1.首先需要下载Clionhttps://www.jetbrains.com/clion/ 下载试用30天试用版后,上网找注册码 http://idea.lanyus.com/ 2.然后下载mingw说明:1. 推荐使用Mingw,个人经验配置起来比Cygwin方便 2. Mingw也直接在官网上下...
2017-10-27 19:37:41
737
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人