diff options
Merge pull request #1 from MariaGrozdeva/patch-1
Update 04. Figures.cpp
1 files changed, 12 insertions, 1 deletions
| -rw-r--r-- | Sem. 02/Solutions/04. Figures.cpp | 13 |
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; + } +} |
