Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace HomeWork
- {
- internal class Program
- {
- public static void Main(string[] args)
- {
- int minValue = 50;
- int maxValue = 150;
- int minNumber = 10;
- int maxNumber = 25;
- int randomNuber;
- Random random = new Random();
- randomNuber = random.Next(minNumber, maxNumber + 1);
- int sum = 0;
- for (int i = 0; i <= maxValue; i += randomNuber)
- {
- if (i >= minValue)
- sum++;
- }
- Console.WriteLine($"Количество чисел, кратных {randomNuber}: {sum}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement