Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Loops
- {
- class Program
- {
- static void Main(string[] args)
- {
- 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} ");
- }
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement