MiroslavKisov

ReverseString

Jan 15th, 2018
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace ReverseString
  5. {
  6.     public class StartUp
  7.     {
  8.         public static void Main()
  9.         {
  10.             string input = Console.ReadLine();
  11.             input.ToCharArray();
  12.             Stack<char> stack = new Stack<char>(input);
  13.             for (int i = 0; i < input.Length; i++)
  14.             {
  15.                 Console.Write(stack.Pop());
  16.             }
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment