Advertisement
Guest User

Untitled

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