Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace multiples
- {
- class Program
- {
- static void Main(string[] args)
- {
- int number;
- int minValue = 1;
- int maxValue = 28;
- int bottomBound = 100;
- int upperBound = 999;
- Random random = new Random();
- number = random.Next(minValue, maxValue);
- int multiplesCount = 0;
- int multiple = number;
- while (multiple < upperBound)
- {
- if(multiple >= bottomBound)
- multiplesCount++;
- multiple += number;
- }
- Console.WriteLine($"Количество кратных N({number}) чисел в диапазоне {bottomBound} - {upperBound}: {multiplesCount}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement