Написать программу решения следующей на c++: определить подходит ли кирпич размером x×y×z в прямоугольное отверстие размером a×b. результат вывести на печать
//Описание добавить не вышло на сайт, посему - в файле
#include "stdafx.h" #include <conio.h>
void swap(short &a, short &b) { short c = a; a = b;
b = c; }
void sort(short &a, short &b, short &c) { short min = a, max = c; if (min > b) min = b; if (min > c) min = c; if (max < a) max = a; if (max < b) max = b; b = a + b + c - min - max; a = min; c = max; }
if ((a1 == a2) && (b1 == b2) && (c1 == c2)) printf("Boxes are equal"); else if ((a1 <= a2) && (b1 <= b2) && (c1 <= c2)) printf_s("The first box is smaller than the second one"); else if ((a2 <= a1) && (b2 <= b1) && (c2 <= c1)) printf_s("The first box is larger than the second one"); else printf_s("Boxes are incomparable");
#include <iostream>
int main()
{
double a, b, x, y, z;
a = b = x = y = z = 0;
std::cout << "A= "; std::cin >> a;
std::cout << "B= "; std::cin >> b;
std::cout << "X= "; std::cin >> x;
std::cout << "Y= "; std::cin >> y;
std::cout << "Z= "; std::cin >> z;
if ((a == x && b == y) && (a == y && b == x))
{
std::cout << "YES\n";
}
else
{
std::cout << "NO\n";
}
return 0;
system("pause");
}