Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Расширение_массива
- {
- class Program
- {
- static void Main(string[] args)
- {
- int Sum = 0;
- string[] array;
- string St_V = Console.ReadLine();
- array = St_V.Split(new char[] { ' ' });
- int[] masInt = new int[array.Length];
- for (int i = 0; i < array.Length; i++)
- {
- masInt[i] = Convert.ToInt32(array[i]);
- Console.Write(masInt[i] + " ");
- Sum += masInt[i];
- }
- Console.WriteLine();
- Array.Sort(masInt);
- var Obr = from i in masInt
- orderby i descending
- select i;
- foreach (int i in Obr)
- Console.Write(i + " ");
- Console.WriteLine();
- Console.WriteLine(Sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement