Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace homeWorkSequence
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int step = 7;
- int startValue = 5;
- int calculationNextNumber = startValue;
- int countNumersInSequence;
- Console.Write("Введите количество цифр в последовательности: ");
- countNumersInSequence = Convert.ToInt32(Console.ReadLine());
- if (countNumersInSequence != 0)
- {
- Console.Write($"{startValue}, ");
- for (int i = 1; i < countNumersInSequence; i++)
- {
- calculationNextNumber += step;
- Console.Write($"{calculationNextNumber}, ");
- }
- }
- else
- {
- Console.WriteLine("Последовательности нет.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement