Сделал 22 Задание

This commit is contained in:
AZEN-SGG 2024-09-25 08:00:08 +03:00
parent 973e407a45
commit 2e4417c1dc
7 changed files with 97 additions and 0 deletions

21
22Ex/make_increasing.c Normal file
View file

@ -0,0 +1,21 @@
#include "make_increasing.h"
int makeIncreasing(FILE * file) {
double current, next;
unsigned short used = 0;
if (fscanf(file, "%lf", &current) != 1) {
printf("File is empty!");
return 0;
}
while (fscanf(file, "%lf", &next) == 1) {
if ((next - current) < DISREG) {
if (used == TRUE) return 0;
used = TRUE;
}
current = next;
}
return 1;
}