Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace _52
- {
- class Program
- {
- static void Main(string[] args)
- {
- var str = Console.ReadLine().Split(' ');
- Stack<int> stack = new Stack<int>();
- for (int i = 0; i <= str.Length-1; i++)
- {
- try
- {
- int p = Int32.Parse(str[i]);
- stack.Push(p);
- }
- catch
- {
- }
- }
- while (stack.Count > 0)
- { Console.Write("{0} ", stack.Pop()); }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement