Last active
February 9, 2025 18:42
-
-
Save KaslGame/290211c1f2d9ac52e2f8629972092a4b 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; | |
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