Advertisement
Guest User

Untitled

a guest
Mar 26th, 2014
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. using System;
  2.  
  3. class OddMultiply
  4. {
  5. static void Main()
  6. {
  7.  
  8. string n = Console.ReadLine();
  9. int odd = 1;
  10. int num;
  11.  
  12. foreach(char item in n)
  13. {
  14. if(Char.IsDigit(item) == true)
  15. {
  16. num = (int)Char.GetNumericValue(item);
  17. if (num % 2 == 1)
  18. {
  19. odd *= num;
  20. }
  21. }
  22.  
  23. }
  24. Console.WriteLine(odd);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement