You are viewing a single comment's thread. Return to all comments →
can u pls help me out? only 2 test cases have been passed.
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */
long max=INT8_MIN; long y=INT8_MAX; long sum=0; long arr[1000]; for(int i=0;i <5;i++){ cin>>arr[i]; sum=sum+arr[i]; } for(int m=0; m<5;m++){ if(max<arr[m]){ max=arr[m]; } } for(int m=0; m<5;m++){ if(y>arr[m]){ y=arr[m]; } } long min_sum=(sum-max); long max_sum=(sum-y); cout<< min_sum << " " << max_sum ; return 0;
}
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
can u pls help me out? only 2 test cases have been passed.
int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */
}