////////////////////////////////////////////////
// TestCalc.cs - A Test program for Calc class
////////////////////////////////////////////////
using System;
using Calc_Int;		//CalcクラスDLL

namespace TestCalc
{
	class SampleCalc
	{
		static void Main()
		{
			string f = "";
			while(true)
			{
				Console.Write("Input math expression (To end, press CR twice): ");
				f = Console.ReadLine();
				if(String.IsNullOrEmpty(f))
					break;
				Calc calc = new Calc(f);
				Console.WriteLine("\r\nIs the expression: {0}, isn't it?", calc.Formula);
				int sol = 0;
				if(calc.TryCalc(ref sol))
					Console.WriteLine("End result is: {0}", sol);
				else
					Console.WriteLine("Can't caluculate the formula.");
			}
			Console.ReadLine();
		}
	}
}
// テスト演算式（答え39）
//(  2 * 9 +  6) * 4 - ( ( 3 * 4 ) * 3 + 12) - 9 
