Advertisement
alex326

Untitled

Jan 22nd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. problema 65
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int n,s=1,c=0;
  8. cin>>n;
  9. while (n!=0){
  10. if (n%10%2==1){
  11. s=s*(n%10);
  12. c++;}
  13. n=n/10;
  14. }
  15. if (c!=0)
  16. cout<<s;
  17. else
  18. cout<<-1;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement