Advertisement
Vadim_Rogulev

Untitled

Apr 17th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 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 Расширение_массива
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.  
  15.             int Sum = 0;
  16.             string[] array;
  17.             string St_V = Console.ReadLine();
  18.             array = St_V.Split(new char[] { ' ' });
  19.             int[] masInt = new int[array.Length];
  20.             for (int i = 0; i < array.Length; i++)
  21.             {
  22.                 masInt[i] = Convert.ToInt32(array[i]);
  23.                 Console.Write(masInt[i] + " ");
  24.                 Sum += masInt[i];
  25.             }
  26.             Console.WriteLine();
  27.             Array.Sort(masInt);
  28.             foreach (int i in masInt)
  29.             Console.Write(i + " ");
  30.             Console.WriteLine();
  31.             Console.WriteLine(Sum);
  32.            
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement