![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++
fallingskies22
这个作者很懒,什么都没留下…
展开
-
算法基础----递归(1)
递归的基本概念一个函数调用其自身,就是递归。例1 求n!的递归函数int Factorial(int n){ if(n==0) return 1; else return n*Factorial(n-1);}递归的作用替代多重循环解决本来就是用递归型式定义的问题将问题分解为规模更小的子问题进行求解…例2 汉诺塔问题void Hanoi(int n,...原创 2019-09-29 10:46:28 · 169 阅读 · 0 评论 -
PTA 甲级 1005
1005 Spell It Right (20 分)Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file co...原创 2019-10-02 09:45:38 · 142 阅读 · 0 评论 -
PTA 甲级 1006
1006 Sign In and Sign Out (25 分)At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the reco...原创 2019-10-02 11:54:54 · 180 阅读 · 0 评论 -
PTA 甲级 1007
1007 Maximum Subsequence Sum (25 分)Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1≤i≤j≤K. The Maximum Subsequ...原创 2019-10-03 13:05:58 · 127 阅读 · 0 评论 -
树和二叉树
明天再写原创 2019-10-04 18:43:33 · 109 阅读 · 0 评论