Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- namespace ReverseString
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] input = Console.ReadLine().Split();
- Stack<string> reversed = new Stack<string>();
- for (int i = 0; i < input.Length; i++)
- {
- string word = "";
- for (int j = input[i].Length - 1; j >= 0; j--)
- {
- word += input[i][j];
- }
- reversed.Push(word);
- }
- Console.WriteLine(String.Join(" ", reversed));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement