Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Calc1/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,19 @@ class Program
{
static void Main(string[] args)
{
Run(args);

if (System.Diagnostics.Debugger.IsAttached)
{
//Give a chance to see the output before the window closes
Console.WriteLine();
Console.WriteLine(@"Press Enter to exit");
Console.ReadLine();
}
}

private static void Run(string[] args)
{
var argBuilder = Initialize(args);

//check to make sure we actually have an argument.
Expand All @@ -49,7 +61,8 @@ static void Main(string[] args)
Console.WriteLine(shunt.Item2);
return;
}
var rpn = shunt.Item1;

var rpn = shunt.Item1;

//calculate the result.
var calcResult = CalculateRpn.RpnResult(rpn);
Expand All @@ -61,7 +74,6 @@ static void Main(string[] args)
}

Console.WriteLine(calcResult.Item1);

}

private static StringBuilder Initialize(string[] args)
Expand Down