#include <bits/stdc++.h>
using namespace std;
int mini = 1e8, maxi = -1e8, ans = 1;
main () {
int a[10];
for (int i = 1; i <= 6; i++)
{
cin >>a[i];
if (a[i] < mini) mini = a[i];
if (a[i] > maxi) maxi = a[i];
ans*=a[i];
}
cout <<ans <<endl << maxi - mini;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <bits/stdc++.h>
using namespace std;
int mini = 1e8, maxi = -1e8, ans = 1;
main () {
int a[10];
for (int i = 1; i <= 6; i++)
{
cin >>a[i];
if (a[i] < mini) mini = a[i];
if (a[i] > maxi) maxi = a[i];
ans*=a[i];
}
cout <<ans <<endl << maxi - mini;
}