Advertisement
anon20016

Untitled

Dec 7th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2.  
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main() {
  7. setlocale(LC_ALL, "Russian");
  8. // int = integer целый тип
  9. // double = double = float вещественный тип
  10. // char символьный тип
  11. // bool переменная типа true/false
  12. // string строка
  13. // = := оператор присвоения
  14. // + - *
  15. // div /
  16. // mod %
  17. // %d целое число
  18. // %f вещественное
  19. // %c char
  20.  
  21. float a, b;
  22. scanf("%f %f", &a, &b);
  23. float srednee_arifm = (a + b) / 2;
  24. float srednee_geometr = sqrt(a * a + b * b);
  25. printf("Среднее арифметическое: %f \nСреднее геометрическое: %f", srednee_arifm, srednee_geometr);
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement