int MaxSub(int *a,int len)
{
int maxS = a[0];
int sub = maxS-a[1];
int i = 1;
for(; i < len; i++)
{
if(sub < (maxS-a[i]))
sub = maxS-a[i];
if(maxS < a[i])
maxS = a[i];
}
return sub;
}
int MaxSub(int *a,int len)
{
int maxS = a[0];
int sub = maxS-a[1];
int i = 1;
for(; i < len; i++)
{
if(sub < (maxS-a[i]))
sub = maxS-a[i];
if(maxS < a[i])
maxS = a[i];
}
return sub;
}