UPC/1sem/programming basics/z2/4.cpp
2019-11-18 10:01:42 +07:00

24 lines
No EOL
576 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// pb_z2_4.cpp
// Горбацевич Андрей
#include <stdio.h>
#include <cmath>
#include <clocale>
#include <afxres.h>
using namespace std;
int main() {
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);
setlocale(LC_ALL, "ru_RU.UTF-8");
double x, a, b, c, d;
printf("x [a b] [c d] >>");
scanf("%lf %lf %lf %lf %lf", &x, &a, &b, &c, &d);
if ((fmin(a, b) <= x && x <= fmax(a, b)) || (fmin(c, d) <= x && x <= fmax(c, d))) {
printf("Принадлежит");
}
else {
printf("Не принадлежит");
};
}