Advertisement
Guest User

386/б

a guest
Jan 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _385b
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double k = double.Parse(Console.ReadLine());
  14. int odd = 0;
  15.  
  16. while (k != 0)
  17. {
  18. double num = double.Parse(Console.ReadLine());
  19. double sum = 0;
  20.  
  21. if (num == 0)
  22. {
  23. k = 0;
  24. }
  25.  
  26. else if (num >= 100 && num <= 999)
  27. {
  28. while (num != 0)
  29. {
  30. sum += num % 10;
  31. num /= 10;
  32. }
  33.  
  34. if (num % 2 != 0)
  35. {
  36. odd++;
  37. }
  38.  
  39.  
  40.  
  41.  
  42. }
  43.  
  44.  
  45. }
  46.  
  47. Console.WriteLine(odd);
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement