Created
March 12, 2025 17:06
-
-
Save fantom44ik/4608c20e9ed8d6e43944f001c883c64d to your computer and use it in GitHub Desktop.
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, ""); | |
//1st | |
int first_num; | |
int second_num; | |
cout << "Введите два числа:\n\n"; | |
cout << "Первое число: "; | |
cin >> first_num; | |
cout << "Второе число: "; | |
cin >> second_num; | |
cout << "\nСумма чисел: " << first_num + second_num << | |
"\nРазность чисел: " << first_num - second_num << | |
"\nПроизведение чисел: " << first_num * second_num << "\n\n\n"; | |
//2nd | |
double number; | |
double percent; | |
cout << "Введите число и процент:\n\n"; | |
cout << "Число: "; | |
cin >> number; | |
cout << "Процент: "; | |
cin >> percent; | |
cout << "\nПроцент из числа: " << (number * percent) / 100 << "\n\n\n"; | |
//3rd | |
int height; | |
int width; | |
cout << "Введите высоту и ширину треугольника:\n\n"; | |
cout << "Высота: "; | |
cin >> height; | |
cout << "Ширина: "; | |
cin >> width; | |
cout << "\nПлощадь треугольника: " << 0.5 * width * height << "\n\n\n"; | |
//4th | |
double celsius; | |
cout << "Введите температуру в градусах цельстия:\n\n"; | |
cout << "Температура: "; | |
cin >> celsius; | |
cout << "\nГрадусы по фаренгейту: " << (celsius * 9/5) + 32 << "\n\n\n"; | |
//5th | |
double first_number; | |
double second_number; | |
double third_number; | |
cout << "Введите три числа:\n\n"; | |
cout << "Первое число: "; | |
cin >> first_number; | |
cout << "Второе число: "; | |
cin >> second_number; | |
cout << "Третье число: "; | |
cin >> third_number; | |
cout << "\nСреднее арефметическое с этих трёх чисел: " << (first_number + second_number + third_number) / 3 << "\n\n\n"; | |
//6th | |
double const Pi = 3.14159; | |
int radius; | |
cout << "Введите радиус окружности: \n\n"; | |
cin >> radius; | |
cout << "\nПлощадь окружности: " << pow(radius, 2) * Pi << | |
"\nДлина окружности: " << 2 * Pi * radius << "\n\n\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hehe