fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. setlocale(LC_ALL, "rus");
  7. int a, b;
  8. double c, d;
  9. cout << "Введите два трехзначных числа" << endl;
  10. cin >> a >> b;
  11. if ((a % 100 / 10) % 2 == 0 || (b % 100 / 10) % 2 == 0)
  12. {
  13. c = pow(a, 2);
  14. d = sqrt(b);
  15. cout << "Первое число: " << c << endl;
  16. cout << "Второе число: " << d << endl;
  17. }
  18. else
  19. {
  20. c = sqrt(a);
  21. d = pow(b, 2);
  22. cout << "Первое число: " << c << endl;
  23. cout << "Второе число: " << d << endl;
  24. }
  25. system("pause");
  26. return 0;
  27. }
Success #stdin #stdout #stderr 0s 4180KB
stdin
113 431
stdout
Введите два трехзначных числа
Первое число: 10.6301
Второе число: 185761
stderr
sh: 1: pause: not found