Last active
February 8, 2025 11:34
-
-
Save 42BOBREEK/6307a9d581b5029d7ae4010d0f489b56 to your computer and use it in GitHub Desktop.
This file contains 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; | |
using System.Text; | |
namespace DZ1 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int minimumNumber = 50; | |
int maximumNumber = 150; | |
int minimumRandomNumber = 10; | |
int maximumRandomNumber = 26; | |
int dividersNum = 0; | |
Random random = new Random(); | |
int number = random.Next(minimumRandomNumber, maximumRandomNumber); | |
Console.WriteLine($"Число - {number}"); | |
for (int i = 0; i <= maximumNumber; i += number) | |
{ | |
if (i >= minimumNumber) | |
{ | |
dividersNum++; | |
} | |
} | |
Console.WriteLine($"Количество кратных чисел числу {number} - {dividersNum} штук."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment