摘要: Description 有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。其中,蜂房的结构如下所示。 有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。其中,蜂房的结构如下所示。 Input 阅读全文
posted @ 2016-06-11 14:37 ly_rabbit 阅读(116) 评论(0) 推荐(0)
摘要: #include int days[12]={31,28,31,30,31,30,31,31,30,31,30,31}; int judge(int a); int main() { int a,b,c,i,sum=0; while(scanf("%d/%d/%d",&a,&b,&c)==3) { sum=0; for(i=0;i<b-1;... 阅读全文
posted @ 2016-06-11 14:29 ly_rabbit 阅读(1729) 评论(0) 推荐(0)
摘要: #include int main() { int n,i,j; long long a[46]; a[0]=0; a[1]=1; for(i=2;i<46;i++) a[i]=a[i-1]+a[i-2]; scanf("%d",&n); while(n--) { scanf("%d",&j); ... 阅读全文
posted @ 2016-06-11 14:28 ly_rabbit 阅读(147) 评论(0) 推荐(0)
摘要: #include void main() { int a; while(scanf("%d",&a)==1) { if((a%4==0 && a%100!=0 )||(a%100==0&&a%400==0)) printf("yes\n"); else printf("no\n"); ... 阅读全文
posted @ 2016-06-11 14:27 ly_rabbit 阅读(111) 评论(0) 推荐(0)
摘要: 从节点为奇数的一个起点出发 源代码如下: 阅读全文
posted @ 2016-06-11 14:24 ly_rabbit 阅读(94) 评论(0) 推荐(0)
摘要: 源代码如下: 阅读全文
posted @ 2016-06-11 14:00 ly_rabbit 阅读(165) 评论(0) 推荐(0)
摘要: 问题描述:共有多少块相邻的空白的区域 注意递归和边界问题的值的设置 源代码如下: 阅读全文
posted @ 2016-06-11 13:33 ly_rabbit 阅读(288) 评论(0) 推荐(0)
摘要: 解析:由二叉树的前序和中序序列,先构建出二叉树,然后再进行后续递归遍历 注意递归停止的条件和相关的用法 源代码如下: 阅读全文
posted @ 2016-06-11 13:19 ly_rabbit 阅读(559) 评论(0) 推荐(0)
摘要: 利用C++自带的栈结构 源代码如下: 实验截图如下: 阅读全文
posted @ 2016-06-11 12:49 ly_rabbit 阅读(616) 评论(0) 推荐(0)
摘要: Description A single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2... 阅读全文
posted @ 2016-06-11 12:34 ly_rabbit 阅读(187) 评论(0) 推荐(0)