#include <iostream>
long prodDigitExcept_2_9(int N) {
long prod = 1;
bool haveNeedDigit = false;
while (N > 0) {
int temp = N % 10;
if (temp != 2 and temp != 9) {
prod *= temp;
haveNeedDigit = true;
}
N /= 10;
if (haveNeedDigit)
return prod;
return -1;
long prodDigit(int N) {
prod *= N % 10;
signed main() {
setlocale(LC_ALL, "Rus");
int N;
std::cin >> N;
long result = prodDigit(N);
if (result == -1)
std::cout << "В данном числе нет подходящих цифр!";
else
std::cout << result;
return 0;
#include <iostream>
long prodDigitExcept_2_9(int N) {
long prod = 1;
bool haveNeedDigit = false;
while (N > 0) {
int temp = N % 10;
if (temp != 2 and temp != 9) {
prod *= temp;
haveNeedDigit = true;
}
N /= 10;
}
if (haveNeedDigit)
return prod;
return -1;
}
long prodDigit(int N) {
long prod = 1;
while (N > 0) {
prod *= N % 10;
N /= 10;
}
return prod;
}
signed main() {
setlocale(LC_ALL, "Rus");
int N;
std::cin >> N;
long result = prodDigit(N);
if (result == -1)
std::cout << "В данном числе нет подходящих цифр!";
else
std::cout << result;
return 0;
}