diff options
Merge branch 'main' of https://github.com/Angeld55/Introduction_to_programming_FMI
2 files changed, 13 insertions, 3 deletions
| -rw-r--r-- | Sem. 02/Solutions/04. Figures.cpp | 13 | ||||
| -rw-r--r-- | Sem. 02/Solutions/05. Time + 15.cpp | 3 |
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; + } +} diff --git a/Sem. 02/Solutions/05. Time + 15.cpp b/Sem. 02/Solutions/05. Time + 15.cpp index 826fa50..5eec960 100644 --- a/Sem. 02/Solutions/05. Time + 15.cpp +++ b/Sem. 02/Solutions/05. Time + 15.cpp @@ -1,7 +1,6 @@ #include <iostream> using namespace std; -const double PI = 3.14; int main() { int hours, mins; @@ -19,4 +18,4 @@ int main() if (mins <= 9) cout << 0; cout << mins << endl; -}
\ No newline at end of file +} |
