Сделал 1 Задание со списками
This commit is contained in:
parent
5dbf4901b8
commit
632a718df1
71 changed files with 106 additions and 0 deletions
21
ProcessingSequences/22Ex/make_increasing.c
Normal file
21
ProcessingSequences/22Ex/make_increasing.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue