Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int minRandomNumber = 1;
- int maxRandomNuber = 28;
- int result = 0;
- int minNumber = 100;
- int maxNumber = 1000;
- Random random = new Random();
- int number = random.Next(minRandomNumber, maxRandomNuber);
- for (int i = 0; i <= maxNumber-1; i += number)
- {
- if (i >= minNumber)
- {
- Console.WriteLine($"\nЧисло: {i}");
- result++;
- }
- }
- Console.WriteLine($"\nКоличество трехзначных натуральных чисел: {result}\nN = {number}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement