Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 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 ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[] list = new int[1];
  14.             int summ;
  15.             bool start = true;
  16.             int i = 0;
  17.  
  18.             Console.WriteLine("Вводите числа и как только введете sum посчитают все числа,sort выведет все числа в порядке уменьшения");
  19.  
  20.             while (start == true)
  21.             {
  22.                 list[i] = Convert.ToInt32(Console.ReadLine());
  23.  
  24.                 int[] templist = new int[list.Length + 1];
  25.                 for (int j = 0; j < list.Length; j++)
  26.                 {
  27.                     templist[j] = list[j];
  28.                 }
  29.                 list = templist;
  30.             }
  31.            
  32.             Console.ReadLine();
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement