Advertisement
Guest User

Untitled

a guest
May 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 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 Les3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.Write("Введите строку, разделяя символы пробелом: ");
  14.             string newString = Console.ReadLine();
  15.             string[] userInput = newString.Split(new char[] { ' ' });
  16.             Console.Clear();
  17.             Console.Write("Полученный массив: ");
  18.             for(int i = 0; i < userInput.Length; i++)
  19.             {
  20.                 Console.Write(userInput[i] + " ");
  21.             }
  22.             Console.WriteLine();
  23.             Console.ReadKey();
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement