21 lines
434 B
C
21 lines
434 B
C
#include "make_increasing.h"
|
|
|
|
int makeIncreasing(FILE * file) {
|
|
double current, next;
|
|
unsigned short used = 0;
|
|
|
|
if (fscanf(file, "%lf", ¤t) != 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;
|
|
}
|