Skip to content

Instantly share code, notes, and snippets.

@plrtp68217
Last active June 3, 2025 11:04
Show Gist options
  • Save plrtp68217/f39ded22d9291834c8aafca5213d9004 to your computer and use it in GitHub Desktop.
Save plrtp68217/f39ded22d9291834c8aafca5213d9004 to your computer and use it in GitHub Desktop.
ДЗ: Кратные числа
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