From df33d0f09328c4e4d0a64f8aebc3b6a82635c784 Mon Sep 17 00:00:00 2001 From: Misha Date: Tue, 9 Sep 2025 20:12:32 +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 --- tak3.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tak3.cpp diff --git a/tak3.cpp b/tak3.cpp new file mode 100644 index 0000000..fc4219f --- /dev/null +++ b/tak3.cpp @@ -0,0 +1,28 @@ +#include +using namespace std; + +int main() { + setlocale(0, ""); + int n; + int x = 0; + int m = 1; + + cout << "Введiть цiле число: "; + cin >> n; + + int old = n; + + for (int i = n; i > 0; i = i / 10) { + int d = i % 10; + + if (d != 3 && d != 6) { + x = x + d * m; + m = m * 10; + } + } + + cout << "Введене число: " << old << endl; + cout << "Нове число (без цифр 3 i 6): " << x << endl; + + return 0; +} \ No newline at end of file