36 lines
696 B
C++
36 lines
696 B
C++
#include <iostream>
|
|
using namespace std;
|
|
|
|
int main() {
|
|
double a;
|
|
double b;
|
|
double c;
|
|
double x;
|
|
double y;
|
|
|
|
cout << "Enter the edges of the brick a, b, c: ";
|
|
cin >> a >> b >> c;
|
|
cout << "Enter the hole dimensions x, y: ";
|
|
cin >> x >> y;
|
|
|
|
double min1 = a, min2 = b;
|
|
|
|
if (c < min1) {
|
|
min2 = min1;
|
|
min1 = c;
|
|
}
|
|
else if (c < min2) {
|
|
min2 = c;
|
|
}
|
|
|
|
if ((min1 <= x && min2 <= y) || (min1 <= y && min2 <= x)) {
|
|
cout << "The brick will pass through the opening." << endl;
|
|
}
|
|
else {
|
|
cout << "The brick won't fit through the opening.." << endl;
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|