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