Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace videoYoutube
- {
- class Program
- {
- static void Main(string[] args)
- {
- string str = Console.ReadLine();
- Stack<int> stack = new Stack<int>();
- int length = 0;
- for (int i = 0; i<=str.Length-1; i++)
- {
- stack.Push(length); //пълни стек с броя чарове, позиции в стринга
- length++;
- }
- length = str.Length-1;
- while (stack.Count > 0)
- {
- stack.Pop(); //намялява стойността на стек каунт контролираща уайл цикъла
- Console.Write(str[length]);
- length--;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement