自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

莫伊的博客

借口是堕落的开始

  • 博客(13)
  • 资源 (3)
  • 收藏
  • 关注

原创 c++读写Excel文件

#include <fstream> #include <string> #include <iostream> #include <sstream> using namespace std; int main() { //打开要输入的文件 ofstream oFile; oFile.open("1.csv", ios::out |

2016-08-30 22:55:13 11351 3

原创 map按value排序

map按value排序#include <iostream> #include <vector> #include <map> #include <string>#include <algorithm>using namespace std;typedef pair<string,int> PAIR;bool cmp_by_value(const PAIR& lhs, const P

2016-08-30 21:57:05 289

原创 字符串匹配

模式匹配(模范匹配):子串在主串中的定位称为模式匹配或串匹配(字符串匹配) 。模式匹配成功是指在主串S中能够找到模式串T,否则,称模式串T在主串S中不存在。 方法一 1.Brute-Force模式匹配算法(暴力匹配法) 设S为目标串,T为模式串,且不妨设:S=“s0 s1 s2…sn-1” , T=“t0 t1 t2 …tm-1” 串的匹配实际上是对合法的位置0≦i≦n-m依次

2016-08-30 14:57:20 338

原创 整型和字符串的相互转换

一、数字转换为字符串int num = 100; char str[25]; itoa(num, str, 10); printf(“num = %d and str= %s. \n” ,num, str); } char *itoa(int value, char *string, int radix) 返回值:指向string这个字符串的指针itoa()函数有

2016-08-30 14:10:47 782

原创 字符串流操作

从文件中读取数据保存到内存中,例如类似Excel表格样的数据#include <iostream>#include <fstream>#include <sstream>#include <string>using namespace std;int main(){ ifstream infile; infile.open("1.txt");

2016-08-28 22:45:54 632

原创 c++两文件之间传递数据

从一个文件中提取文件放入到另外一个文件中#include <iostream>#include <fstream>using namespace std;int main(){ ofstream outfile; //终端输入--》内存--》文本 outfile.open("2.txt");//(输入流) (变量)(输出文件流) ifstream infile;

2016-08-28 21:21:39 3133

原创 c++将数据保存到txt

从窗口输入的数据保存到txt文件中 tips:定义的流与变量间用插入运算符即可。#include <iostream>#include <fstream>#include <string>#include <vector>using namespace std;int main(){ ofstream outfile; //终端输入--》内存--》文本 outf

2016-08-28 21:12:08 23382

原创 c++从txt文件中读取数据

从txt文本中读取数据存入数组中#include <iostream>#include <fstream>#include <string>#include <vector>using namespace std;int main(){ ifstream infile; infile.open("1.txt"); if(!infile) cout<<"error"<

2016-08-28 20:39:43 67549 4

原创 STL总结

一、介绍 STL(Standard Template Library),即标准模板库,该库包含了诸多常用的基本数据结构和基本算法。 从逻辑层次来看,在STL中体现了泛型化程序设计的思想(generic programming),引入了诸多新的名词,比如像需求(requirements),概念(concept),模型(model),容器(container),算法(algorithmn),迭代

2016-08-28 20:17:02 389

原创 Rotate List

描述Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->nullptr and k = 2, return 4->5->1->2->3->nullptr.分析先遍历一遍,得出链表长度len,注意k 可能大于len,因此令k

2016-08-27 00:20:08 345

原创 Reverse Linked List II

描述Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->nullptr, m = 2 and n = 4, return 1->4->3->2->5->nullptr. Note: Given m, n satisfy the

2016-08-26 23:44:53 446

原创 leetcode中常用函数和类型

边做题边整理吧!好多不常用经常忘记函数Function for_each(InputIterator first, InputIterator last, Function f){ for ( ; first!=last; ++first ) f(*first); return f;}解释:迭代器所标记范围内的每个元素赋给f作为参数,并返回计算后的f, f不一定是函数。 例

2016-08-26 22:33:55 1195

原创 reverse a linked list

题目Reverse a linked list from position 0 to n-1. For example: Given 1->2->3->4->5->nullptr, return 5->4->3->2->1->nullptr.分析方法1 迭代思路: (1)已知原链表头节点指针head (2)建立一个一个新节点dummy,令其next指针指向head (3)从head开始,

2016-08-26 21:23:11 563

正版好用vb软件

vb软件 , 正版简单好用,本人一直在用,未发现任何缺点

2013-04-17

北邮matlab实验报告

北京邮电大学信息与通信工程学院matlab实验一

2013-04-17

计算机控制系统

北邮计算机控制系统课件 张秦艳 第二章离散控制系统ppt

2013-04-09

空空如也

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

TA关注的人

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