------------只要够努力,人生最坏的结局不过是大器晚成!!!

随笔分类 -  基础函数

20-list简单使用:
摘要:C++list的使用总结及常用list操作 C++中list用法详解 STL中list的erase()方法的使用 STL中list的erase()方法的使用 listiterator 最近刚刚接触stl的list 学习的时候遇到了很多的困难 现在记录一下 主要是erase方法的使用 erase()方 阅读全文
posted @ 2018-08-29 21:13 ystraw 阅读(167) 评论(0) 推荐(0)
19-字符切割函数c++模板
摘要:https://www.cnblogs.com/stonebloom-yu/p/6542756.html 阅读全文
posted @ 2018-08-28 16:03 ystraw 阅读(132) 评论(0) 推荐(0)
18-printf(*)的输出格式
摘要:#include using namespace std; int main(){ for(int i = 0; i < 26; i++){ cout << (char)('a' + i); } cout << endl; printf("%.*lf\n", 4, 5.123456); printf("%*.*f\n", 20, 4, 1234.56); //不输出10和4... 阅读全文
posted @ 2018-05-05 20:38 ystraw 阅读(187) 评论(0) 推荐(0)
17-pow(c++)
摘要:C++中有封装的pow()可以直接调用,头文件math,同时对函数进行了重载,支持多种参数格式: double pow (double base , double exponent); float pow (float base , float exponent); long double pow (long double base, long d... 阅读全文
posted @ 2018-05-05 20:28 ystraw 阅读(303) 评论(0) 推荐(0)
16-math_M_PI
摘要:头文件math.h中宏定义的是M_PI#define M_PI 3.14159265358979323846所以不需要记忆PI的值了可以直接用 阅读全文
posted @ 2018-05-05 20:19 ystraw 阅读(135) 评论(0) 推荐(0)
15-struct(构造函数,重载)
摘要:必须充分掌握struct的使用,包括其构造和重载函数的写法: 阅读全文
posted @ 2018-03-31 12:32 ystraw 阅读(1188) 评论(0) 推荐(0)
14-stringstream
摘要:C++中stringstream的使用方法和样例 原创 2016年11月06日 15:46:49 标签: string / C++ 7427 原创 2016年11月06日 15:46:49 标签: string / C++ 7427 之前在leetcode中进行string和int的转化时使用过is 阅读全文
posted @ 2018-03-23 17:49 ystraw 阅读(132) 评论(0) 推荐(0)
13-STL-二分查找
摘要:STL中提供-二分查找算法(binary_search lower_bound upper_bound equal_range STL包含四种不同的二分查找算法,binary_search lower_bound upper_bound equal_range.他们作用的range是已sorted。 阅读全文
posted @ 2018-03-20 22:15 ystraw 阅读(131) 评论(0) 推荐(0)
12-scanf("%*s")与printf("%*s")
摘要:在scanf里用*修饰符,是起到过滤读入的作用。比如一个有三列数值的数据,我只想得到第2列数值,可以在循环里用scanf(“%*d%d%*d”,a[i])来读入第i行的第2个数值到a[i]。 * 修饰符在printf中的含义完全不同。如果写成printf(“%6d”, 123),很多同学应该就不会陌 阅读全文
posted @ 2018-03-19 19:31 ystraw 阅读(383) 评论(0) 推荐(0)
11-vector的使用
摘要:C++ vector用法(详解!!函数,实现) 原创 2016年09月30日 01:13:40 7862 原创 2016年09月30日 01:13:40 7862 1,简述一下vector的基本操作,它的size,capacity(),clear,reverse,reserve, push_back 阅读全文
posted @ 2018-02-27 23:47 ystraw 阅读(303) 评论(0) 推荐(0)
10-stack
摘要:c++ stl栈stack介绍 C++ Stack(堆栈) 是一个容器类的改编,为程序员提供了堆栈的全部功能,——也就是说实现了一个先进后出(FILO)的数据结构。 c++ stl栈stack的头文件为: #include <stack> c++ stl栈stack的成员函数介绍 操作 比较和分配堆 阅读全文
posted @ 2018-02-12 12:37 ystraw 阅读(162) 评论(0) 推荐(0)
9-queue
摘要:在C++中只要#include<queue>即可使用队列类,其中在面试或笔试中常用的成员函数如下(按照最常用到不常用的顺序) 1. push 2. pop 3. size 4. empty 5. front 6. back 接下来逐一举例说明: 1. push 队列中由于是先进先出,push即在队尾 阅读全文
posted @ 2018-02-12 12:34 ystraw 阅读(129) 评论(0) 推荐(0)
8-全排列next_permutation
摘要:C++中全排列函数next_permutation 用法 转载 2017年03月29日 14:38:25 1560 转载 2017年03月29日 14:38:25 1560 全排列参考了两位的博客 感谢! http://blog.sina.com.cn/s/blog_9f7ea4390101101u 阅读全文
posted @ 2018-02-11 18:35 ystraw 阅读(266) 评论(0) 推荐(0)
7-set用法详解
摘要:C++中set用法详解 转载 http://blog.csdn.net/yas12345678/article/details/52601454 C++ / set 转载 http://blog.csdn.net/yas12345678/article/details/52601454 C++ / 阅读全文
posted @ 2018-02-08 22:45 ystraw 阅读(290) 评论(0) 推荐(0)
6-关于#include<bits/stdc++.h>
摘要:万能头文件#include<bits/stdc++.h> (转载) 最近在打cf时赛后翻阅别人的代码总是会发现一个陌生而奇怪的头文件#include<bits/stdc++.h> 奇怪之处就在于基本上所有的代码只要用了这个头文件就不再写其他头文件了。 百度过后仿佛打开了新世界的大门,头文件居然还可以 阅读全文
posted @ 2018-02-03 12:53 ystraw 阅读(431) 评论(0) 推荐(0)
5-math中函数汇总
摘要:math.h 数学函数库,一些数学计算的公式的具体实现是放在math.h里,具体有:1 三角函数double sin (double);double cos (double);double tan (double);2 反三角函数double asin (double); 结果介于[-PI/2, P 阅读全文
posted @ 2018-02-03 12:23 ystraw 阅读(214) 评论(0) 推荐(0)
4-memset函数总结
摘要:头文件:cstring 或 memory 一般用处: memset(arr, 0, sizeof(aar)); //初始化为0 memset(arr, -1, sizeof(aar)); //初始化为-1 memset(arr,0x7F,sizeof(arr)) = memset(aar, 127, 阅读全文
posted @ 2018-01-30 23:04 ystraw 阅读(660) 评论(1) 推荐(0)
3-交换两个数
该文被密码保护。
posted @ 2017-12-18 22:17 ystraw 阅读(1) 评论(0) 推荐(0)
2-string相关函数
摘要:string真的很好用,希望通过逐步的学习逐渐掌握的string的用法: 1. append() -- 在字符串的末尾添加字符 2. find() -- 在字符串中查找字符串 4. insert() -- 插入字符 5. length() -- 返回字符串的长度 6. replace() -- 替换 阅读全文
posted @ 2017-09-01 18:55 ystraw 阅读(196) 评论(0) 推荐(0)


不经一番切孤寒,怎得梅花扑鼻香