Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit61a1a195e4eea5cdea8355fd7d9c78d7c84b6ad2 (patch)
Author
 MariaGrozdeva <64608453+MariaGrozdeva@users.noreply.github.com>
2021-10-17 16:28:37 +0300
Committer
 GitHub <noreply@github.com>
2021-10-17 16:28:37 +0300
Filese40a9e157acda80315e3929cef6853c9fe860002
Introduction_to_programming_FMI-61a1a195e4eea5cdea8355fd7d9c78d7c84b6ad2.tar
Introduction_to_programming_FMI-61a1a195e4eea5cdea8355fd7d9c78d7c84b6ad2.tar.gz
Introduction_to_programming_FMI-61a1a195e4eea5cdea8355fd7d9c78d7c84b6ad2.zip
Parent917bf2164175f9436f0796cf433bd00fe42f8a5e (diff)
Update 04. Figures.cpp
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;
+ }
+}