Created
May 20, 2025 10:26
-
-
Save BitMounter/2e63b9736dad48b2ebc936459668dbd4 to your computer and use it in GitHub Desktop.
Home Work 16: Quantity Of Multiples V3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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