Untitled
raw download clone
TEXT
views 34
,
size 321 b
#include<iostream>
using namespace std;
int P(int x[],int n,int &mini,int &maxi,int &sum)
{
    if(n==1)
        mini=maxi=sum=x[0];
    else
    {
        P(x,n-1,mini,maxi,sum);
        if(mini>x[n-1])
            mini=x[n-1];
        if(maxi<x[n-1])
            maxi=x[n-1];
        sum+=x[n-1];
    }
}
close fullscreen
Login or Register to edit or fork this paste. It's free.