Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "Russian");
- // int = integer целый тип
- // double = double = float вещественный тип
- // char символьный тип
- // bool переменная типа true/false
- // string строка
- // = := оператор присвоения
- // + - *
- // div /
- // mod %
- // %d целое число
- // %f вещественное
- // %c char
- float a, b;
- scanf("%f %f", &a, &b);
- float srednee_arifm = (a + b) / 2;
- float srednee_geometr = sqrt(a * a + b * b);
- printf("Среднее арифметическое: %f \nСреднее геометрическое: %f", srednee_arifm, srednee_geometr);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement