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 _06_Stop_Number
- {
- class Program
- {
- static void Main(string[] args)
- {
- var n = int.Parse(Console.ReadLine()); //[0... < m
- var m = int.Parse(Console.ReadLine()); //n < ...10000]
- var s = int.Parse(Console.ReadLine()); //n <= s <= m
- int num = m;
- bool stop = true;
- while (stop)
- {
- if (num == n) stop = false;
- if (num % 2 == 0 && num % 3 == 0)
- {
- if (num == s) stop = false;
- else Console.Write($"{num} ");
- }
- num--;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment