Advertisement
Guest User

vtora zadacha

a guest
Jan 18th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace ConsoleApp1
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. int a = Convert.ToInt32(Console.ReadLine());
  11. int b = Convert.ToInt32(Console.ReadLine());
  12.  
  13.  
  14. List<int> result = new List<int>();
  15. for (int i = a; i <= b; i++)
  16. {
  17. if (i%2==1)
  18. {
  19. result.Add(i);
  20.  
  21. }
  22. }
  23.  
  24. Console.WriteLine(String.Join(" ", result.ToArray()));
  25.  
  26. }
  27.  
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement