Skip to content

Instantly share code, notes, and snippets.

@KaslGame
Last active February 9, 2025 18:42
Show Gist options
  • Save KaslGame/290211c1f2d9ac52e2f8629972092a4b to your computer and use it in GitHub Desktop.
Save KaslGame/290211c1f2d9ac52e2f8629972092a4b to your computer and use it in GitHub Desktop.
using System;
namespace Learn
{
class Program
{
static void Main(string[] args)
{
Random random = new Random();
int minN = 10;
int maxN = 26;
int minNumber = 50;
int maxNumber = 151;
int countNaturalNumbers = 0;
int numberN = random.Next(minN, maxN);
int number = random.Next(minNumber, maxNumber);
Console.WriteLine("N = " + numberN);
for (int i = 0; i < maxNumber; i += numberN)
{
if (i >= minNumber)
{
Console.WriteLine($"Число: {i} \nКратное число");
countNaturalNumbers++;
}
}
Console.WriteLine($"Количество чисел: {countNaturalNumbers}");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment