eolymp
bolt
Try our new interface for solving problems
Problems

The product of even digits in a number

published at 11/14/15, 4:07:50 pm

не проходить 7 тест не розумію чому? підскажіть. Розв'язок 2254698

published at 9/30/17, 10:38:32 pm

Используй long long, а не int

published at 4/27/20, 5:07:46 pm

You can use string to solve this problem, if someone wanna see my code, you can inform me by inbox:)

published at 10/12/22, 3:30:45 pm

Якщо число відємне присто при обчисленні не враховуйте мінус і при виводі числа просто виводите добуток без мінуса

published at 2/20/24, 3:55:06 pm

include <bits/stdc++.h>

using namespace std; int main() { long long sol=1, m, n; cin >> n; if(n < 0) n*=-1; if(n==0) sol = 0; else sol=1; while(n) { m = n % 10; if(m%2 == 0) sol*=m; n/=10; } if(sol==1) cout << -1; else cout << sol; return 0; }