Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exam
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. int m = int.Parse(Console.ReadLine());
  11. int s = int.Parse(Console.ReadLine());
  12. for (int currentHouse = m; currentHouse >= n; currentHouse--)
  13. {
  14. if (currentHouse % 2 == 0 && currentHouse % 3 == 0)
  15. {
  16. if (currentHouse == s)
  17. {
  18. break;
  19. }
  20. Console.Write(currentHouse + " ");
  21. }
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement