initial commit
This commit is contained in:
39
src/LAB2.c
Normal file
39
src/LAB2.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "../include/LAB2.h"
|
||||
#include "../include/LAB1.h"
|
||||
|
||||
void lab_2()
|
||||
{
|
||||
double v = 0.0, w_min = 0.0, w_max = 0.0;
|
||||
uint32_t d = 0;
|
||||
|
||||
printf("Enter [V]: ");
|
||||
READ_EXACT("%lf", v);
|
||||
|
||||
printf("Enter [W_min]: ");
|
||||
READ_EXACT("%lf", w_min);
|
||||
|
||||
printf("Enter [W_max]: ");
|
||||
READ_EXACT("%lf", w_max);
|
||||
|
||||
printf("Enter [d]: ");
|
||||
READ_EXACT("%d", d);
|
||||
|
||||
printf("Z(V=%lf, W=[%lf; %lf]): [ ", v, w_min, w_max);
|
||||
|
||||
for (uint32_t i = 0; i < d; ++i)
|
||||
{
|
||||
double w = w_min + (w_max - w_min) * ((double)i / (d - 1));
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
printf(", ");
|
||||
}
|
||||
|
||||
printf("%lf", z(v, w));
|
||||
}
|
||||
|
||||
printf(" ]\n");
|
||||
}
|
||||
Reference in New Issue
Block a user