Advertisement
SaNik74

Multiplicity numbers

Feb 19th, 2023 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. internal class Program
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         Random random = new Random();
  8.         int minNumberN = 1;
  9.         int maxNumberN = 27;
  10.         int startNumber = 100;
  11.         int finishNumber = 999;
  12.         int numberN = random.Next(minNumberN, maxNumberN + 1);
  13.         int quantity = 0;
  14.  
  15.         for (int i = startNumber; i <= finishNumber; i+=numberN)
  16.         {
  17.             if (i >= startNumber)
  18.             {
  19.                 quantity++;
  20.             }
  21.         }
  22.         Console.WriteLine(numberN);
  23.         Console.WriteLine(quantity);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement