Advertisement
drunin89

06. Stop Number

Nov 13th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace StopNumber
  8. {
  9.     class StopNumber
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var n = int.Parse(Console.ReadLine());
  14.             var m = int.Parse(Console.ReadLine());
  15.             var s = int.Parse(Console.ReadLine());
  16.                     for (int i = m; i >= n; i--)
  17.                     {
  18.                         if (i % 2 == 0 && i % 3 == 0)
  19.                         {
  20.                             if (i != s)
  21.                             {
  22.                                 Console.Write("{0} ",i);
  23.                             }
  24.                             else
  25.                             {
  26.                                 break;
  27.                             }
  28.  
  29.                         }
  30.                         else
  31.                         {
  32.                         }
  33.                     }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement