Last active
June 3, 2025 11:04
-
-
Save plrtp68217/f39ded22d9291834c8aafca5213d9004 to your computer and use it in GitHub Desktop.
ДЗ: Кратные числа
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 Task | |
{ | |
public class Programm | |
{ | |
public static void Main(string[] args) | |
{ | |
Random random = new Random(); | |
int minNumber = 10; | |
int maxNumber = 25; | |
int number = random.Next(minNumber, maxNumber + 1); | |
int rangeStart = 50; | |
int rangeEnd = 150; | |
int entryCount = 0; | |
for (int i = 0; i <= rangeEnd; i += number) | |
{ | |
if (i >= rangeStart) | |
{ | |
entryCount++; | |
} | |
} | |
Console.WriteLine($"{entryCount} чисел, которые кратны {number}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment