Advertisement
elena1234

ReverseStrings

Nov 12th, 2020 (edited)
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3. using System.Linq;
  4.  
  5. namespace ReverseStrings
  6. {
  7.     class MainClass
  8.     {
  9.         public static void Main(string[] args)
  10.         {
  11.             string word = Console.ReadLine();
  12.             while (word != "end")
  13.             {
  14.                 char[] reverseWord = word.Reverse().ToArray();
  15.                 Console.WriteLine($"{word} = {string.Join("",reverseWord)}");
  16.                 word = Console.ReadLine();
  17.             }
  18.         }
  19.     }
  20. }
  21.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement