Files
IT-Step/tak3.cpp
2025-09-09 20:12:57 +03:00

28 lines
516 B
C++
Raw Permalink 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.

#include <iostream>
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;
}