SaNik74

subsequence

Feb 15th, 2023 (edited)
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1.  
  2. internal class Program
  3. {
  4.     static void Main(string[] args)
  5.     {
  6.         int cycleStartNumber;
  7.         int stepSize;
  8.         int maxNumberInCycle;
  9.  
  10.         Console.Write("Введите число с которого начнется вывод последовательности: ");
  11.         cycleStartNumber = Convert.ToInt32(Console.ReadLine());
  12.  
  13.         Console.Write("Введите размер шага последовательности: ");
  14.         stepSize = Convert.ToInt32(Console.ReadLine());
  15.  
  16.         Console.Write("Введите максимальное число последовательности: ");
  17.         maxNumberInCycle = Convert.ToInt32(Console.ReadLine());
  18.  
  19.         for (int i = cycleStartNumber; i <= maxNumberInCycle; i += stepSize)
  20.         {
  21.             Console.Write($"{i} ");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment