日期:2014-05-17 浏览次数:20943 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string s = "5*10=?";
string[] nums = s.Split('+', '-', '*', '/', '=');
int xpos = nums.ToList().FindIndex(x => x == "?");
string op = Regex.Match(s, @"[+\-*\/]").Value;
Dictionary<string, Func<int, int, int>> dict1 = new Dictionary<string, Func<int, int, int>>()
{
{ "+", new Func<int, int, int>((x, y) => x + y) },