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