#include <stdio.h>
int main() {
int n;
printf("Type n: ");
scanf("%d", &n);
double arr[n];
printf("Type elements of sequence: ");
for (int i = 0; i < n; ++i) {
scanf("%lf", &arr[i]);
}
double max = arr[0], min = arr[0];
for (int i = 1; i < n; ++i) {
if (max < arr[i])
max = arr[i];
if (min > arr[i])
min = arr[i];
printf("Result: %.2lf", max - min);
return 0;
#include <stdio.h>
int main() {
int n;
printf("Type n: ");
scanf("%d", &n);
double arr[n];
printf("Type elements of sequence: ");
for (int i = 0; i < n; ++i) {
scanf("%lf", &arr[i]);
}
double max = arr[0], min = arr[0];
for (int i = 1; i < n; ++i) {
if (max < arr[i])
max = arr[i];
if (min > arr[i])
min = arr[i];
}
printf("Result: %.2lf", max - min);
return 0;
}