
C++
李奶奶喝牛奶
与其感慨路难行,不如拔起树根砍了就跑
展开
-
C++文件操作
主要是多个文件的读写#include <iostream>#include <string>#include <fstream>using namespace std;int main(){ char s[12]; char buffer[256]; string a="D:\\txt\\"; string c; const char *b;原创 2017-10-19 21:20:46 · 271 阅读 · 0 评论 -
C++将csv文件数据读入数组中
将形如 1,2,3 4,5,6 7,8,9 的csv文件数据放入二维数组中。 #include <iostream> #include <string> #include <vector> #include <fstream> #include <sstream> using namespace原创 2017-10-23 18:57:12 · 17633 阅读 · 2 评论 -
C++Dijkastra算法实现
Dijkastra算法的主要思想是: 将顶点分为两组,一组为使用过的顶点S,另一组为未使用过的顶点U,假设起始顶点为v,dist[]为v距离各其它顶点的最短距离,每次迭代选取未使用过且路径最短的顶点加入S,并以此顶点为pre顶点继续寻找其它最短路段,直至S包含所有顶点。#include <iostream>using namespace std;const int maxnum = 100;转载 2017-10-23 20:22:39 · 1011 阅读 · 0 评论 -
C++\String常用操作
#include <iostream>#include <string>using namespace std;int main(){ // string类的字符串链接以及初始化赋值 string a="a"; string b="b"; string c=a+b; // string类的字符串链接以及初始化赋值 //string的原创 2017-11-01 21:46:44 · 359 阅读 · 0 评论 -
C++字符型数组常用函数
C++字符型数组常用函数 函数名: strcmp 功 能: 串比较 用 法: int strcmp(char *s1, char *s2); 当s1#include <string.h> #include <stdio.h> int main(void) { char *buf1 = "aaa", *buf2 = "bbb", *buf3 = "ccc"; i转载 2017-11-01 21:32:55 · 2656 阅读 · 0 评论