2019年3月9日

LeetCode_80

摘要: 题目描述: Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate 阅读全文

posted @ 2019-03-09 17:16 harchar 阅读(142) 评论(0) 推荐(0)

LeetCode_27

摘要: 题目描述: Given an array nums and a value val, remove all instances of that value in-placeand return the new length. Do not allocate extra space for anoth 阅读全文

posted @ 2019-03-09 17:11 harchar 阅读(76) 评论(0) 推荐(0)

LeetCode_26

摘要: 题目描述: Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate ext 阅读全文

posted @ 2019-03-09 17:09 harchar 阅读(98) 评论(0) 推荐(0)

LeetCode_283

摘要: 题目描述: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. 实现思路: 定义区间 阅读全文

posted @ 2019-03-09 17:03 harchar 阅读(88) 评论(0) 推荐(0)

2019年3月3日

数学拾遗_1

摘要: 对于任意一个无理数α,我们一定能够找到两个有理数列 α1,α2,... 及 α1‘,α2’,... 使得αn < α < αn' , 且 lim αn = lim αn' = α 阅读全文

posted @ 2019-03-03 14:21 harchar 阅读(160) 评论(0) 推荐(0)

2019年3月1日

C语言控制流之switch

摘要: switch语句 优点: 可以把若干个分支组合在一起完成一个任务。 隐患: 但是正常情况下为了防止直接进入下一个分支执行,每个分支后必须以break语句结束。从一个分支直接进入下一个分支执行的做法并不健全,这样在做程序修改时很容易出错。 建议: 在switch语句最后一个分支的后面(即default 阅读全文

posted @ 2019-03-01 20:43 harchar 阅读(262) 评论(0) 推荐(0)

2019年2月23日

C语言的枚举常量与枚举变量

摘要: 最近复习C语言的时候发现自己对枚举类型印象很模糊,于是查了一下。 例:enum Boolean{NO,YES}; 其中 NO,YES是枚举常量; 我们也可以声明枚举类型的变量。 例: enum Boolean b; b = NO; 这里 b 是枚举变量,并且其值只能为Boolean枚举列表中定义的常 阅读全文

posted @ 2019-02-23 14:28 harchar 阅读(2133) 评论(0) 推荐(0)

导航