摘要: 题目: Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right corner 阅读全文
posted @ 2016-08-01 21:48 绵绵思远道 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题目: Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 阅读全文
posted @ 2016-08-01 21:43 绵绵思远道 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 1.开在栈里的数组(int a[n];)在出栈也就是函数结束时会释放掉,所以如果函数想返回一个数组的话,不能返回函数里面的数组的首地址,但是开在堆里(int *a=new int[n];)就可以。 2.栈空间有限,递归的时候注意层数不能太深,在函数里的数组不能太大。 阅读全文
posted @ 2016-08-01 21:14 绵绵思远道 阅读(1091) 评论(0) 推荐(0) 编辑