摘要: #include #include using namespace std;struct SqList { int *elem; int length;};int InitList(SqList &L,int num){ L.elem = new i... 阅读全文
posted @ 2018-11-05 22:04 xyee 阅读(117) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;void StrAssign(char *T){ char ch; int i=1; cout>ch&&ch!='0') { T[i++]=ch; } T[0]=i-1+'0'; coutT... 阅读全文
posted @ 2018-11-05 22:03 xyee 阅读(121) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;void StrAssign(char *T){ char ch; int i=1; cout>ch&&ch!='0') { T[i++]=ch; } T[0]=i-1+'0'; coutT... 阅读全文
posted @ 2018-11-05 22:01 xyee 阅读(421) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;struct SqStack { char *base; char *top;};int cmp[10][10] = { {'>','>','','>'},//+ {'>','>','','>... 阅读全文
posted @ 2018-11-05 21:59 xyee 阅读(777) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;const int INIT_SIZE=100;const int INCREASE=10;struct SqStack { int *base; int *top; int stacksiz... 阅读全文
posted @ 2018-11-05 21:57 xyee 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 逆波兰表达式是一种把运算符前置的算术表达式(其实一般教科书上称这种表达式为波兰表达式),例如普通的表达式2 + 3的逆波兰表示法为+ 2 3。逆波兰 表达式的优点是运算符之间不必有优先级关系,也不必用括号改变运算次序,例如 (2 + 3) * 4的逆波兰表示法为* + 2 3 4。本题求解逆波兰表达 阅读全文
posted @ 2018-11-05 21:54 xyee 阅读(439) 评论(0) 推荐(0) 编辑
摘要: 逆波兰表达式是一种把运算符前置的算术表达式(其实一般教科书上称这种表达式为波兰表达式),例如普通的表达式2 + 3的逆波兰表示法为+ 2 3。逆波兰 表达式的优点是运算符之间不必有优先级关系,也不必用括号改变运算... 阅读全文
posted @ 2018-11-05 21:54 xyee 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 主要是对位运算的操作,,每次加一。#include #include using namespace std;int main(){ int n, num, a[1024], b[1024][10], cnt, cmp,cnt1 = 0, cnt2 = 0, k = ... 阅读全文
posted @ 2018-11-04 19:42 xyee 阅读(592) 评论(0) 推荐(0) 编辑
摘要: 问题:n皇后问题:输入整数n, 要求n个国际象棋的皇后,摆在 n*n的棋盘上,互相不能攻击,输出全部方案。#include using namespace std;int N;int queuePos[100];... 阅读全文
posted @ 2018-11-01 17:51 xyee 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 问题: n皇后问题:输入整数n, 要求n个国际象棋的皇后,摆在 n*n的棋盘上,互相不能攻击,输出全部方案。 其实递归就是另一种循环,因为不能写不定循环,所以用递归解决。 阅读全文
posted @ 2018-11-01 17:51 xyee 阅读(148) 评论(0) 推荐(0) 编辑