01 2016 档案
vector-C++标准模板库
摘要:vector-C++标准模板库一、vector容器是C++标准模板库中的部分内容,能够操作多种数据结构和算法的模板类和函数库。与普通数组不同的是,用vector定义的数组对象的所有元素都会被初始化。若是基本数据类型,则以0初始化;若是类类型,则以类的默认构造函数初始化(必须含有)。1.用vector... 阅读全文
posted @ 2016-01-26 13:32 Xbert 阅读(319) 评论(0) 推荐(0)
sort-函数
摘要:sort-对给定区间所有元素进行排序一、两个参数的sort(begin,end),begin,end表示一个范围,默认为升序。需要引用#include 示例如下:#include #include using namespace std;int main(){ int a[10]= {21,4... 阅读全文
posted @ 2016-01-26 10:25 Xbert 阅读(205) 评论(0) 推荐(0)
C语言-通讯录
摘要:1 #include 2 #include 3 #include 4 5 typedef struct address_list 6 { 7 char name[30];//姓名 8 char work[30];//职业 9 char phone[... 阅读全文
posted @ 2016-01-19 17:51 Xbert 阅读(1026) 评论(0) 推荐(0)
C语言-五子棋
摘要:1 #include 2 #include 3 #include 4 5 #define N 19 6 int pieces[N][N]= {0}; //五子棋盘19*19 7 int flag=1; //状态,0-无子;1-A子;2-B子 8 9 void Draw... 阅读全文
posted @ 2016-01-14 15:10 Xbert 阅读(461) 评论(0) 推荐(0)
C语言-文件块操作
摘要:1 #include 2 #include 3 #define FILENAME "E:\\FUSHI\\students.txt" 4 5 struct student 6 { 7 int num;//学号 8 char name[20];//姓名 9 char r... 阅读全文
posted @ 2016-01-12 22:18 Xbert 阅读(305) 评论(0) 推荐(0)
C语言-文件基本操作
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 #define FILENAME "E:\\FUSHI\\test.txt" 6 7 int main() 8 { 9 /* 10 新建文件... 阅读全文
posted @ 2016-01-12 18:44 Xbert 阅读(307) 评论(0) 推荐(0)
机试-括号匹配
摘要:1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 stack S; 8 char str[110]; 9 char ans[110];10 11 int main()12 {13 while(scanf("... 阅读全文
posted @ 2016-01-07 15:16 Xbert 阅读(203) 评论(0) 推荐(0)
机试-表达式求值
摘要:1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 char str[220]; //表达式字符串 8 int mat[][5]= 9 { 10 1,0,0,0,0, 11 1,0... 阅读全文
posted @ 2016-01-07 15:16 Xbert 阅读(257) 评论(0) 推荐(0)
数据结构-二叉树
摘要:以下为二叉树的各种遍历的C语言实现程序,包括先序、中序、后序遍历(递归和非递归实现)和层次遍历。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 typedef struct BiTNode 9 { 10 char data; 11 ... 阅读全文
posted @ 2016-01-04 11:11 Xbert 阅读(268) 评论(0) 推荐(0)