上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 30 下一页
摘要: 题意就是给出9位以内的数字,按照汉子的读法读出来。 读法请看下方的几个例子: 5 0505 0505 伍亿零伍佰零伍万零伍佰零伍 5 5050 5050 伍亿伍仟零伍拾万伍仟零伍拾 (原本我以为这个是读:伍亿伍仟零伍拾万"零"伍仟零伍拾) 5 0550 0055 伍亿零伍佰伍拾万零伍拾伍 5 500 阅读全文
posted @ 2017-02-11 22:28 辰曦~文若 阅读(1091) 评论(0) 推荐(0)
摘要: 给定区间[L,R],给出在这区间之内的学生,并且按照他们的成绩非升序的顺序输出。 #include <iostream> #include <cstdio> #include <string.h> #include <algorithm> using namespace std; const int 阅读全文
posted @ 2017-02-11 22:23 辰曦~文若 阅读(278) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cstdio> #include <string.h> #include <algorithm> using namespace std; const int maxn=90; char str1[maxn]; char str2[maxn 阅读全文
posted @ 2017-02-11 22:20 辰曦~文若 阅读(199) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cmath> using namespace std; const int maxn=100000+5; long lon 阅读全文
posted @ 2017-02-11 12:05 辰曦~文若 阅读(213) 评论(0) 推荐(0)
摘要: 题意:用栈的push、pop操作给出一棵二叉树的中序遍历顺序,求这棵二叉树的后序遍历。 需要一个堆结构s,一个child变量(表示该节点是其父亲节点的左孩子还是右孩子),父亲节点fa对于push v操作:1).第一个push肯定是根节点root。2).根据child变量,建立fa与v的父子关系。3) 阅读全文
posted @ 2017-02-11 11:34 辰曦~文若 阅读(1233) 评论(0) 推荐(0)
摘要: 判断插入排序很好判断,不是的话那就是归并排序了。 由于归并排序区间是2、4、8开始递增的,所以要判断给出的归并排序执行到哪一步,就要k从2开始枚举。 然后再对每个子区间进行一下sort即可。 #include <iostream> #include <cstdio> #include <algori 阅读全文
posted @ 2017-02-11 11:22 辰曦~文若 阅读(466) 评论(0) 推荐(0)
摘要: 给出一棵树,在树根出货物的价格为p,然后每往下一层,价格增加r%,求所有叶子节点中的最高价格,以及该层叶子结点个数。 #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cm 阅读全文
posted @ 2017-02-11 11:09 辰曦~文若 阅读(325) 评论(0) 推荐(0)
摘要: 给出两个字符串,判断第二个字符串中的字符是否都出现在第一个中。 是,则输出Yes,以及多余的字符的个数。 否,则输出No,以及缺失的个数。 #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> u 阅读全文
posted @ 2017-02-11 10:58 辰曦~文若 阅读(288) 评论(0) 推荐(0)
摘要: 如题,统计PAT出现的个数,注意PAT不一定要相邻,看题目给的例子就知道了。 num1代表目前为止P出现的个数,num12代表目前为止PA出现的个数,num123代表目前为止PAT出现的个数。 遇到P,num1++。 遇到A,那么PA的个数为:前面统计的PA的个数(num12)+前面的P与当前A组成 阅读全文
posted @ 2017-02-10 11:10 辰曦~文若 阅读(277) 评论(0) 推荐(0)
摘要: 题目很简单,就是统计一下每层的节点数,输出节点数最多的个数和对应的层数即可。 #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> using namespace std; const int m 阅读全文
posted @ 2017-02-10 10:52 辰曦~文若 阅读(279) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 30 下一页