Advertisement
aspire12

4.ReverseArrayOfStrings

Feb 8th, 2020
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _4.ReverseArrayOfStrings
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //Read an array of strings (space separated values), reverse it and print its elements
  10.  
  11.             string input = Console.ReadLine();
  12.             string[] inputArray = input.Split();
  13.             for (int i = 0; i < inputArray.Length; i++)
  14.             {
  15.                 Console.Write(inputArray[inputArray.Length - 1 - i] + " ");
  16.             }
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement