From 61a1a195e4eea5cdea8355fd7d9c78d7c84b6ad2 Mon Sep 17 00:00:00 2001 From: MariaGrozdeva <64608453+MariaGrozdeva@users.noreply.github.com> Date: Sun, 17 Oct 2021 16:28:37 +0300 Subject: Update 04. Figures.cpp --- Sem. 02/Solutions/04. Figures.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Sem. 02/Solutions') diff --git a/Sem. 02/Solutions/04. Figures.cpp b/Sem. 02/Solutions/04. Figures.cpp index 170c403..3e4b974 100644 --- a/Sem. 02/Solutions/04. Figures.cpp +++ b/Sem. 02/Solutions/04. Figures.cpp @@ -25,4 +25,15 @@ int main() cin >> R; cout << PI * R * R << endl; } -} \ No newline at end of file + else if (figure == 't') + { + double width; + double height; + cin >> width >> height; + cout << width * height / 2 << endl; + } + else + { + cout << "Invalid figure!" << endl; + } +} -- cgit v1.3.1-23-gd82d