上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 19 下一页
摘要: #include #include #include using namespace std; //post expression compute int compute(int num1, int num2, char op) { if (op == '+') return num1 + num2; else if (op == '-') return num1 - num2; ... 阅读全文
posted @ 2016-10-20 12:24 KennyRom 阅读(194) 评论(0) 推荐(0)
摘要: #include #include #include #include using namespace std; char compare(char tp, char op) { if (((tp == '+' || tp == '-') && (op == '*' || op == '/')) || (tp == '#')) return ''; } int main() { st... 阅读全文
posted @ 2016-10-20 12:06 KennyRom 阅读(482) 评论(0) 推荐(0)
摘要: #include #include #include #include using namespace std; char compare(char tp, char op) { if (((tp == '+' || tp == '-') && (op == '*' || op == '/')) || tp == '#') return ''; } int main() { stac... 阅读全文
posted @ 2016-10-20 11:05 KennyRom 阅读(168) 评论(0) 推荐(0)
摘要: #include #include #include using namespace std; char compare(char tp, char op) { if (((tp == '+' || tp == '-') && (op == '*' || op == '/')) || (tp == '#')) return ''; } int compute(int n1, int n... 阅读全文
posted @ 2016-10-20 10:34 KennyRom 阅读(286) 评论(0) 推荐(0)
摘要: #include #include #include using namespace std; char compare(char tp, char op) { if (((tp == '+' || tp == '-') && (op == '*' || op == '/')) || (tp == '#')) return ''; } int compute(int n1, int n... 阅读全文
posted @ 2016-10-20 09:58 KennyRom 阅读(184) 评论(0) 推荐(0)
摘要: 1、数组 数组的特点: 元素数目固定;下标有界。 数组的操作: 按照下标进行读写。 2、数组的顺序表示和实现 因计算机的内存结构是一维的,因此用一维内存来表示多维数组,就必须按某种次序将数组元素排成一列序列,然后将这个线性序列存放在储存器中。 通常有两种顺序存储方式: (1)行优先顺序——将数组元素 阅读全文
posted @ 2016-10-18 00:32 KennyRom 阅读(3344) 评论(0) 推荐(0)
摘要: 1、Definition 串string,是零个或多个字符组成的有限序列。一般记作S="a1a2a3...an",其中S是串名,双引号括起来的字符序列是串值;ai(1<= i <=n)可以是字母、数字或其他字符;串中所包含的字符个数称为该串的长度。长度为零的串称为空串(Empty String),不 阅读全文
posted @ 2016-10-17 21:19 KennyRom 阅读(315) 评论(0) 推荐(0)
摘要: 优先队列是单向队列的一种,可以按照默认或自定义的一种方式来对队列中的数据进行动态排序 用法: 1、默认用<运算符进行排序 大的先输出 2、priority_queue<type, vector<type>, fun<type>>pq; vector<type>为容器类型 fun<type>为比较函数 阅读全文
posted @ 2016-10-16 23:24 KennyRom 阅读(175) 评论(0) 推荐(0)
摘要: //双端队列 //deque的成员函数 c.assign(beg, end); //将[beg, end]区间中的数据赋值给c c.assign(n, elem); //将n个elem的拷贝赋值给c c.at(idx); //传回索引idx所指的数据,如果idx越界,抛出out_of_range c.back(); ... 阅读全文
posted @ 2016-10-16 21:57 KennyRom 阅读(181) 评论(0) 推荐(0)
摘要: //deque /* what is a deque? In Chinese, it's called "双端队列". It's different from a queue. Its elements can be added to or removed from either the front(head) or back(tail) ,called a head-tail linked l... 阅读全文
posted @ 2016-10-16 20:17 KennyRom 阅读(291) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 19 下一页