摘要: #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 阅读(131) 评论(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 阅读(432) 评论(0) 推荐(0)
摘要: #include #include using namespace std;struct SqStack { char *base; char *top;};int cmp[10][10] = { {'>','>','','>'},//+ {'>','>','','>... 阅读全文
posted @ 2018-11-05 21:59 xyee 阅读(798) 评论(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 阅读(163) 评论(0) 推荐(0)
摘要: 逆波兰表达式是一种把运算符前置的算术表达式(其实一般教科书上称这种表达式为波兰表达式),例如普通的表达式2 + 3的逆波兰表示法为+ 2 3。逆波兰 表达式的优点是运算符之间不必有优先级关系,也不必用括号改变运算... 阅读全文
posted @ 2018-11-05 21:54 xyee 阅读(282) 评论(0) 推荐(0)
摘要: 逆波兰表达式是一种把运算符前置的算术表达式(其实一般教科书上称这种表达式为波兰表达式),例如普通的表达式2 + 3的逆波兰表示法为+ 2 3。逆波兰 表达式的优点是运算符之间不必有优先级关系,也不必用括号改变运算次序,例如 (2 + 3) * 4的逆波兰表示法为* + 2 3 4。本题求解逆波兰表达 阅读全文
posted @ 2018-11-05 21:54 xyee 阅读(501) 评论(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 阅读(646) 评论(0) 推荐(0)
摘要: 问题:n皇后问题:输入整数n, 要求n个国际象棋的皇后,摆在 n*n的棋盘上,互相不能攻击,输出全部方案。#include using namespace std;int N;int queuePos[100];... 阅读全文
posted @ 2018-11-01 17:51 xyee 阅读(80) 评论(0) 推荐(0)
摘要: 问题: n皇后问题:输入整数n, 要求n个国际象棋的皇后,摆在 n*n的棋盘上,互相不能攻击,输出全部方案。 其实递归就是另一种循环,因为不能写不定循环,所以用递归解决。 阅读全文
posted @ 2018-11-01 17:51 xyee 阅读(155) 评论(0) 推荐(0)
摘要: 题目背景 这是一道模板题 题目描述 给定n,p求1~n中所有整数在模p意义下的乘法逆元。 输入输出格式 输入格式: 一行n,p 输出格式: n行,第i行表示i在模p意义下的逆元。 输入输出样例 输入样例#1: 输出样例#1: 说明 1≤n≤3×10^6 , n<p<20000528 输入保证 p 为 阅读全文
posted @ 2018-10-28 19:36 xyee 阅读(155) 评论(0) 推荐(0)