Advertisement
vencinachev

StopNum

Nov 28th, 2021
855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Loops
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             int m = int.Parse(Console.ReadLine());
  11.             int s = int.Parse(Console.ReadLine());
  12.             for (int i = m; i >= n; i--)
  13.             {
  14.                 if (i % 2 == 0 && i % 3 == 0)
  15.                 {
  16.                     if (i == s)
  17.                     {
  18.                         break;
  19.                     }
  20.                     Console.Write($"{i} ");
  21.                 }
  22.             }
  23.             Console.WriteLine();
  24.         }
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement