
C/C++ 情景补充(课本例题练习/课外素材)
文章平均质量分 73
锐不可当cr
持续努力 保持激情 勿忘初心
展开
-
C++ 矩阵A+B(九度OJ 1001)
题目描述: This time, you are supposed to find A+B where A and B are two matrices, and then count the number of zero rows and columns.输入: The input consists of several test cases, each原创 2016-08-23 15:58:23 · 743 阅读 · 0 评论 -
排列组合问题初步
1. 从n个人中选择k个人的不同组合数法一:递归 由n个人里选k个人的组合数=由n-1个人里选k个人的组合数+由n-1个人里选k-1个人的组合数。此公式本身是递归的,因此可编写递归函数实现这一过程,其中递推结束条件是n=k或k=0,这时的组合数为1,然后开始回归。源代码:#include using namespace std;int comm(int n,int原创 2016-09-29 19:12:56 · 864 阅读 · 0 评论 -
C Number Steps(九度OJ 1136)
题目描述:Starting from point (0,0) on a plane, we have written all non-negative integers 0,1,2, ... as shown in the figure. For example, 1, 2, and 3 has been written at points (1,1), (2,0), and (3, 1)原创 2016-10-01 23:24:50 · 428 阅读 · 0 评论