Сделал 1 Задание со списками

This commit is contained in:
AZEN-SGG 2024-10-04 10:43:43 +03:00
parent 5dbf4901b8
commit 632a718df1
71 changed files with 106 additions and 0 deletions

View file

@ -0,0 +1,25 @@
#include <stdio.h>
#include "tools.h"
#include "exp_weigh_avg.h"
/*
Çàäàíèå 38
Ïðèìåð:
5 4 3 2 1 è ëÿìáäà: 0.5
Îòâåò: 1.83...
*/
int main(void) {
double lambda;
FILE * file = getFile();
printf("Enter lambda: ");
scanf("%lf", &lambda);
if (betweenZeroOne(lambda) == FALSE) {
printf("Lambda is not between 0 to 1!");
return -1;
}
printf("The exponentially weighted average is %lf\n", expWeigthAvg(file, lambda));
return 0;
}