Created the 2023_11_20 solution_1.cpp

This commit is contained in:
Mathias Wagner 2023-11-20 11:10:08 +01:00
parent f1eaeebd08
commit 52cdef645c
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -0,0 +1,33 @@
#include <iostream>
using namespace std;
int main() {
// Variablendeklaration
double length, width, height, volume;
char restart;
while (restart != 'n') {
cout << "Geben Sie die Laenge ein: ";
cin >> length;
cout << "Geben Sie die Breite ein: ";
cin >> width;
cout << "Geben Sie die Hoehe ein: ";
cin >> height;
// Berechnung
volume = length * width * height;
// Ausgabe
cout.setf(ios::fixed);
cout.precision(1);
cout << "Volumen: " << volume << " m3" << endl;
// Wiederholung
cout << "Wollen Sie nochmal? (j/n): ";
cin >> restart;
}
}