Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics.Metrics;
- namespace кратность
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Random random = new Random();
- int minNumberInSequence = 1;
- int maxNumberInSequence = 27;
- int minNumberToCheck = 100;
- int maxNumberToCheck = 1000;
- int count = 0;
- int randomNumber = random.Next(minNumberInSequence, maxNumberInSequence + 1);
- Console.WriteLine($"Число N {randomNumber}");
- for (int i = 0; i < maxNumberToCheck; i += randomNumber)
- {
- if (i >= minNumberToCheck)
- {
- count++;
- }
- }
- Console.WriteLine($"Количество трехзначных чисел, кратных {randomNumber}: {count}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement