算法
文章平均质量分 70
sola_aptx4869
这个作者很懒,什么都没留下…
展开
-
统计数字问题
题目选自王晓东的《计算机算法设计与分析》。。为什么用这本书呢,因为这是我们的教材啊,哈哈哈。 题目意思是这样的,输入一个数,统计1到这个数中,0-9出现的个数; 这个题的直觉是用暴力法,一个一个数循环,进行统计各个位数中数字出现的次数。 然后我写了这个暴力法: #include void process_number(int* a,int num) { int x; while(num原创 2014-02-22 21:13:13 · 747 阅读 · 0 评论 -
Leetcode-Maximum Product Subarray
ind the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest原创 2014-12-02 12:24:12 · 594 阅读 · 0 评论