From 0e5b06ff82bd8b06714f6090cc17eb175f6672e1 Mon Sep 17 00:00:00 2001 From: Misha Date: Tue, 9 Sep 2025 19:17:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?/=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- checer.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 checer.cpp diff --git a/checer.cpp b/checer.cpp new file mode 100644 index 0000000..13a986b --- /dev/null +++ b/checer.cpp @@ -0,0 +1,38 @@ +#include +using namespace std; + +int main() { + setlocale(0, ""); + int a; + int b; + int x; + + cout << "Введiть нижню межу дiапазону: "; + cin >> a; + + cout << "Введiть верхню межу дiапазону: "; + cin >> b; + + if (a > b) { + int temp = a; + a = b; + b = temp; + cout << "Границi помiняно мiсцями. Дiапазон: [" << a << ", " << b << "]" << endl; + } + + do { + cout << "Введiть число для перевiрки: "; + cin >> x; + + if (x < a || x > b) { + cout << "Число " << x << " не потрапляє в дiапазон [" + << a << ", " << b << "]" << endl; + } + + } while (x < a || x > b); + + cout << "Вiдмiнно! Число " << x << " потрапляє в дiапазон [" + << a << ", " << b << "]" << endl; + + return 0; +}