Advertisement
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 StopNumber
- {
- class StopNumber
- {
- static void Main(string[] args)
- {
- int end = int.Parse(Console.ReadLine());
- int start = int.Parse(Console.ReadLine());
- int stopNumber = int.Parse(Console.ReadLine());
- for (int i = start; i >= end; i--)
- {
- if (i % 2 == 0 && i % 3 == 0 && i != stopNumber)
- {
- Console.Write("{0} ", i);
- }
- else if (i % 2 == 0 && i % 3 == 0 && i == stopNumber)
- {
- break;
- }
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement