From 77249dd538d2f8c2ead38a4d83f0d4bd04139439 Mon Sep 17 00:00:00 2001 From: Nurahmed Almadatov Date: Mon, 6 Feb 2023 01:05:12 +0100 Subject: [PATCH] add vshift --- src/funktion.c | 5 +++++ src/funktion.h | 2 ++ src/main.c | 11 +++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/funktion.c b/src/funktion.c index 379dde9..06b20d5 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -118,3 +118,8 @@ double trapezFlaeche(double a, double b, double h) { double result=(a + b) * h / 2; return result; } + +float Vshift(float x1, float s1) { + printf("%f\n\n", x1 + (s1)); + return x1 + (s1); +} diff --git a/src/funktion.h b/src/funktion.h index 763db87..182c43c 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -23,4 +23,6 @@ double Stueckzeitakkort(double stueckkosten,double akkordzuschlag,double arbeits double erloesfunktion(double p,double q); double grenzGewinn(double p,double q,double tc); double GewinnMaximum(double p,double q,double tc,double tr); +float Vshift(float x1,float s1); + #endif diff --git a/src/main.c b/src/main.c index e7ae7e2..3d7e033 100644 --- a/src/main.c +++ b/src/main.c @@ -6,8 +6,7 @@ int main() { - double a,b,c,d,h; - + double a,b,c,d,h,x1,s1; a = getValue('a'); b = getValue('b'); h = getValue('h'); @@ -100,4 +99,12 @@ int main() c= getValue('K'); d= getValue('F'); GewinnMaximum(a,b,c,d); + + printf("Vektor\n"); + printf("x eingeben"); + x1 = getValue('X'); + printf("Verschiebung\n"); + printf("> verschiebung"); + s1 = getValue('s'); + Vshift(x1,s1); }