Advertisement
anna1121550

Untitled

Sep 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace GoodOfMe
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("Напишите количество чисел, которые необходимо вывести");
  14.             Console.ReadKey();
  15.             string text = Console.ReadLine();
  16.             int x = Convert.ToInt32(text);
  17.             int[] array = new int[x];
  18.             int s = 1;
  19.             int q = 0;
  20.             int w = 1;
  21.             for (int i = 0; i < x; i++);
  22.             {
  23.                 int n = 0;
  24.                 s = w + q;
  25.                 w = s;
  26.                 q = w;
  27.                 array[n] = s;
  28.                 n++;
  29.             }
  30.             for (int i = 0; i < x; i++) ;
  31.             {
  32.                 int n = 0;
  33.                 Console.WriteLine(" " + array[n]);
  34.                 Console.ReadKey();
  35.                 n++;
  36.             }
  37.            
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement