From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- Bachelor/Prog1/Prakt1/prg1pr1_3/prg1pr1_3.cpp | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Bachelor/Prog1/Prakt1/prg1pr1_3/prg1pr1_3.cpp (limited to 'Bachelor/Prog1/Prakt1/prg1pr1_3/prg1pr1_3.cpp') diff --git a/Bachelor/Prog1/Prakt1/prg1pr1_3/prg1pr1_3.cpp b/Bachelor/Prog1/Prakt1/prg1pr1_3/prg1pr1_3.cpp new file mode 100644 index 0000000..880b7b9 --- /dev/null +++ b/Bachelor/Prog1/Prakt1/prg1pr1_3/prg1pr1_3.cpp @@ -0,0 +1,50 @@ +// Programmieren 1, Praktikum 1, Aufgabe 3 +// Sven Eisenhauer +// 27.10.2004 + +#include + +int main() +{ + int iInOp1,iInOp2,iInOp3; // 3 operants, user input + int iMin,iMax; + + std::cout << "Bitte drei unterschiedliche ganze Zahlen eingeben:\n"; + std::cin >> iInOp1; + std::cin >> iInOp2; + std::cin >> iInOp3; + std::cout << "\nDie Summe ist " << iInOp1 + iInOp2 + iInOp3; + std::cout << "\nDer Mittelwert ist "<< (static_cast (iInOp1 + iInOp2 + iInOp3))/3; + std::cout << "\nDas Produkt ist " << (iInOp1 * iInOp2 * iInOp3); + + if (iInOp1iInOp2 && iInOp1>iInOp3) + { + iMax=iInOp1; + } + if (iInOp2>iInOp1 && iInOp2>iInOp1) + { + iMax=iInOp2; + } + if (iInOp3>iInOp1 && iInOp3>iInOp1) + { + iMax=iInOp3; + } + + std::cout << "\nDer kleinste Wert ist "<