Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class OddMultiply
- {
- static void Main()
- {
- string n = Console.ReadLine();
- int odd = 1;
- int num;
- foreach(char item in n)
- {
- if(Char.IsDigit(item) == true)
- {
- num = (int)Char.GetNumericValue(item);
- if (num % 2 == 1)
- {
- odd *= num;
- }
- }
- }
- Console.WriteLine(odd);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement