Advertisement
SaNik74

multiplicity number

Feb 16th, 2024
922
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1.     internal class Program
  2.     {
  3.         static void Main(string[] args)
  4.         {
  5.             Random random = new Random();
  6.             int minValueNumberN = 10;
  7.             int maxValueNumberN = 25;
  8.             int startNumber = 50;
  9.             int endNumber = 150;
  10.             int numberN = random.Next(minValueNumberN, maxValueNumberN + 1);
  11.             int result = 0;
  12.  
  13.             for (int i = startNumber; i <= endNumber; i += numberN)
  14.             {
  15.                 if (i <= startNumber)
  16.                 {
  17.                     result++;
  18.                 }
  19.             }
  20.  
  21.             Console.WriteLine($"Количество чисел от {startNumber} до {endNumber} кратны {numberN}");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement