Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 12 insertions, 1 deletions
-rw-r--r--Sem. 02/Solutions/04. Figures.cpp13
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;
+ }
+}