c***l 发帖数: 8 | 1 A DP algorithm based on the balance partition algorithm (can google find the
algorithm) for the first question.
大牛看看有什么问题.
#include
#include
#include
using namespace std;
extern int mindiff(int i, int A[]);
int main()
{
int A[5]={3, 5, 7, 11, 13};
int min;
min=mindiff(5,A);
cout<
}
int mindiff(int n, int A[])
{
int i, j;
int max=0;
int jmin;
int result;
double min;
double sum=0;
for(i=0;i<=n-1;i++) { sum+=A[... 阅读全帖 |
|