随笔分类 -  活动活动

摘要:先给出实现程序,如下: 1: int max_sub_sum2(const int v[],int n) 2: { 3: int max=0; 4: int currentSum=0; 5: int i=0; 6: 7: for(i=0;i<n;i++) 8: { 9: currentSum+=v... 阅读全文
posted @ 2012-06-17 13:33 Dance With Automation 阅读(354) 评论(0) 推荐(0)
摘要:依旧先摆出算法代码: 1: int get_common_divisor(int a,int b) 2: { 3: int x=a; 4: int y=b; 5: int m=0; 6: 7: while(y>0) 8: { 9: m=x%y; 10: x=y; ... 阅读全文
posted @ 2012-06-17 13:32 Dance With Automation 阅读(269) 评论(0) 推荐(0)
摘要:1: #include <stdio.h> 2: #include <stdlib.h> 3: 4: int sc=0; 5: int max3(int a,int b, int c) 6: { 7: sc++; 8: if(a>b) 9: { 10: return a>c?a:c; 11: ... 阅读全文
posted @ 2012-06-15 08:56 Dance With Automation 阅读(440) 评论(0) 推荐(0)