![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
王紫川
这个作者很懒,什么都没留下…
展开
-
给定一个整数n,从n开始向螺旋展开,如下为n=12的情况,编写程序打印n=100的表
给定一个整数n,从n开始向螺旋展开,如下为n=12的情况, 6 5 4 3 7 12 11 2 8 9 10 1 编写程序打印n=100的表。 规律 以上文的n=12为例子,现在数组中间放入12 ,然后 向右走1步输出11, 向下走1步输出10, 向左走2步输出9,8; 向上走2布输出7,6; …… 依次右下左上地走,直到数字1的出现 其中 第一第二步步长为1 第三第四步步长为2 第四第五步步长为...原创 2020-04-05 22:27:18 · 577 阅读 · 2 评论 -
李白喝酒问题递归求解
c++源码 #include <iostream> using namespace std; int count1 = 0; char a[15]; void fun(int store, int flower, int wine, int i) { if ((store > 5) || (flower > 10)) return; else if ((sto...原创 2020-03-29 16:25:31 · 529 阅读 · 0 评论