Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _06.Reverse_Array_of_Strings
- {
- class Program
- {
- static void Main(string[] args)
- {
- string text = Console.ReadLine();
- string[] reversedText = text.Split(' ');
- for (int index = 0; index < reversedText.Length / 2 ; index++)
- {
- var temp = reversedText[index];
- reversedText[index] = reversedText[reversedText.Length - index - 1];
- reversedText[reversedText.Length - index - 1] = temp;
- }
- for (int index = 0; index < reversedText.Length; index++)
- {
- Console.Write($"{reversedText[index]} ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement