Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 49 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Program
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             //Stack<int> stack = new Stack<int>();
  13.             //stack.Push(5);
  14.             //stack.Push(66);
  15.             //Console.WriteLine(stack.Peek());
  16.             //Console.ReadLine();
  17.             //stack.Pop();
  18.             //Console.WriteLine(stack.Peek());
  19.             //Console.ReadLine();
  20.  
  21.             Stack<string> stack = new Stack<string>();
  22.             string inmatning = Console.ReadLine();
  23.             for (int i = 0; i < inmatning.Length; i++)
  24.             {
  25.                 Convert.ToChar(inmatning[i]);
  26.                 //Convert.ToChar(inmatning);
  27.                 if (inmatning == "(") //|| (inmatning[i] == "{") || (inmatning[i] == "[") )
  28.                 {
  29.                     stack.Push(inmatning[i]);
  30.                 }
  31.                 //if ((inmatning[i] = ")") || (inmatning[i] = "]") || (inmatning[i] = "}"))
  32.                 //{
  33.                 //    stack.Pop();
  34.                 //}
  35.                 //else
  36.                 //{
  37.  
  38.                 //}
  39.                 Console.WriteLine(stack.Peek());
  40.             }
  41.             Console.ReadLine();
  42.  
  43.         }
  44.     }
  45. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top