Advertisement
Spocoman

01. Reverse Strings

Apr 12th, 2023
681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. namespace ReverseStrings
  6. {
  7.  
  8.     class Program
  9.     {
  10.         static void Main()
  11.         {
  12.             string word;
  13.  
  14.             while((word = Console.ReadLine()) != "end")
  15.             {
  16.                 Console.WriteLine($"{word} = {string.Join("", word.ToCharArray().Reverse())}");
  17.             }
  18.            
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement