Skip to content

Instantly share code, notes, and snippets.

@BitMounter
Created May 20, 2025 10:26
Show Gist options
  • Save BitMounter/2e63b9736dad48b2ebc936459668dbd4 to your computer and use it in GitHub Desktop.
Save BitMounter/2e63b9736dad48b2ebc936459668dbd4 to your computer and use it in GitHub Desktop.
Home Work 16: Quantity Of Multiples V3
using System;
namespace HomeWork16QuantityOfMultiplesV3
{
internal class Program
{
static void Main(string[] args)
{
int multiple;
int countOfMultiple = 0;
int minValueOfMultiple = 10;
int maxValueOfMultiple = 25;
int minEdge = 50;
int maxEdge = 150;
Random random = new Random();
multiple = random.Next(minValueOfMultiple, maxValueOfMultiple + 1);
for (int i = multiple; i <= maxEdge; i += multiple)
if (i >= minEdge)
countOfMultiple++;
Console.WriteLine($"N = {multiple}, в диапазоне от {minEdge} до {maxEdge} есть {countOfMultiple} чисел, кратных N");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment