Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.Collections.Generic;
- namespace _9._5
- {
- class Program
- {
- static void Main()
- {
- Console.WriteLine("Введи последовательность:");
- List<int> spisok = new List<int>();
- while(true)
- {
- int number = int.Parse(Console.ReadLine());
- spisok.Add(number);
- if (spisok.Count > 2)
- if (spisok[spisok.Count - 1] != spisok[spisok.Count - 2] + spisok[spisok.Count - 3])
- {
- Console.WriteLine("Не последовательность!");
- break;
- }
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement