Сделал 15ю Задачу

This commit is contained in:
AZEN-SGG 2024-11-01 07:05:41 +03:00
parent 4c36e1638a
commit 4e498f2819
8 changed files with 133 additions and 54 deletions

View file

@ -4,12 +4,20 @@
int main(void) {
double * numbers;
unsigned length;
FILE * file = getFile();
if (file == NULL) return -1;
numbers = getList(file);
if (numbers == NULL) return 1;
printf("Count elements in file: %d", findAndReplaceLocalMin(numbers));
length = find_replace_local_min(&numbers[1], (int)numbers[0] - 1);
for (int i = 1; i < (int)length + 1; ++i) {
printf("%.1lf ", numbers[i]);
}
free(numbers);
return 0;
}