Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
2,148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 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 fifth
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int start = int.Parse(Console.ReadLine());
  14. int end = int.Parse(Console.ReadLine());
  15.  
  16. int firstStart = start / 1000;
  17. int secondStart = (start / 100) % 10;
  18. int thirdStart = (start / 10) % 10;
  19. int fourthStart = start % 10;
  20.  
  21. int firstEnd = end / 1000;
  22. int secondEnd = (end / 100) % 10;
  23. int thirdEnd = (end / 10) % 10;
  24. int fourthEnd = end % 10;
  25.  
  26. for (int i = firstStart; i <= firstEnd; i++)
  27. {
  28. for (int j = secondStart; j <= secondEnd; j++)
  29. {
  30. for (int k = thirdStart; k <= thirdEnd; k++)
  31. {
  32. for (int l = fourthStart; l <= fourthEnd; l++)
  33. {
  34. if (i % 2!= 0 && j % 2 != 0 && k %2 != 0 && l % 2 !=0 )
  35. {
  36. Console.Write("{0}{1}{2}{3} ", i, j ,k, l);
  37. }
  38. }
  39. }
  40. }
  41. }
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement