Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace GiftsfromSanta
- {
- class Program
- {
- static void Main()
- {
- int N = int.Parse(Console.ReadLine());
- int M = int.Parse(Console.ReadLine());
- int S = int.Parse(Console.ReadLine());
- for (int i = M; i >= N; i--)
- {
- if (i % 2 == 0 && i % 3 == 0)
- {
- if (i == S)
- {
- break;
- }
- Console.Write($"{i} ");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement