Created
March 18, 2025 13:52
-
-
Save DO162/6024dd71df18fa3e6bfb7ac61a05158a to your computer and use it in GitHub Desktop.
DZ_2_(11.03.25)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
setlocale(0, ""); | |
cout << "#1\n"; | |
cout << "Перше число: "; | |
int num_1; | |
cin >> num_1; | |
cout << "Друге число: "; | |
int num_2; | |
cin >> num_2; | |
cout << "Сума чисел: " << num_1 + num_2 << ".\n"; | |
cout << "Рiзниця чисел: " << num_1 - num_2 << ".\n"; | |
cout << "Добуток чисел: " << num_1 * num_2 << ".\n\n"; | |
cout << "#2\n"; | |
cout << "Перше число(значення): "; | |
int value; | |
cin >> value; | |
cout << "Друге число(вiдсоток): "; | |
int percent; | |
cin >> percent; | |
cout << "Вiдсоток вiд числа: " << (value * percent) / 100 << "%\n\n"; | |
cout << "#3\n"; | |
cout << "Ширина прямокутника: "; | |
int width; | |
cin >> width; | |
cout << "Висота прямокутника: "; | |
int height; | |
cin >> height; | |
cout << "Площа прямокутника: " << width * height << " см2.\n\n"; | |
cout << "#4\n"; | |
cout << "Температура по шкалi Цельсiя: "; | |
double temp; | |
cin >> temp; | |
cout << "Температура по шкалi Фаренгейта: " << (temp * 9 / 5) + 32 << ".\n\n"; | |
cout << "#5\n"; | |
cout << "Перше число: "; | |
double nums_1; | |
cin >> nums_1; | |
cout << "Друге число: "; | |
double nums_2; | |
cin >> nums_2; | |
cout << "Третє число: "; | |
double nums_3; | |
cin >> nums_3; | |
cout << "Середнє арифметичне трьох дробових чисел: " << (nums_1 + nums_2 + nums_3) / 3 << ".\n\n"; | |
cout << "#6\n"; | |
cout << "Радiус кола: "; | |
int radius; | |
cin >> radius; | |
const double PI = 3.1415926; | |
cout << "Площа кола: " << PI * radius * radius << ".\n"; | |
cout << "Довжина кола: " << 2 * PI * radius << ".\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment