Advertisement
Spocoman

04. Reverse Array of Strings

Jan 20th, 2022
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace ReverseArrayOfStrings
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string[] arr = Console.ReadLine().Split().Reverse().ToArray();
  11.  
  12.             Console.WriteLine(string.Join(' ', arr));
  13.         }
  14.     }
  15. }
  16.  
  17.  
  18. Тарикатско решение:
  19.  
  20. using System;
  21. using System.Linq;
  22.  
  23. namespace ReverseArrayOfStrings
  24. {
  25.     class Program
  26.     {
  27.         static void Main(string[] args)
  28.         {
  29.             Console.WriteLine(string.Join(' ', Console.ReadLine().Split().Reverse()));
  30.         }
  31.     }
  32. }
  33.  
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement