Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Stop_Number
- {
- 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());
- if (S % 2 == 0 && S % 3 == 0)
- {
- for (int i = M; i >= N; i--)
- {
- if (i % 2 == 0 && i % 3 == 0)
- {
- if (i == S)
- {
- break;
- }
- Console.Write(i + " ");
- }
- }
- }
- else
- {
- for (int i = M; i >= N; i--)
- {
- if (i % 2 == 0 && i % 3 == 0)
- {
- Console.Write(i + " ");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment