Олимпиадный тренинг

Задача 34797. We process the digits of the number - 3


Задача

Темы: Цикл while
Given a natural number N that does not contain the digit 0. Determine the product of its digits that are multiples of z. If there are no digits that are multiples of z, then print 0.

Input 
Enter two numbers separated by a space, first a natural number N, then - z (\(0 < z <= 9\ )).

Imprint 
Output the answer to the problem.

 

Examples
# Input Output
1 432 2 8

Запрещенные операторы:break;list;[