Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

#include <iostream>

using namespace std;

int main()

int n, c, p = 1, ok;

cin >> n;

ok=false;

while (n)

c = n % 10;

if ( c % 2 == 1 )

p = p * c;

ok=true;

n /= 10;

if (ok) cout << p;

else cout << -1;

return 0;

You might also like