Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace Calculadora
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("----------------------------------------------------------");
- Console.WriteLine("----------------------------------------------------------");
- Console.WriteLine("--------------------Elige opción: ------------------------");
- //Elije opcion 1 -> lectura y escritura en fichero y 2 bucle while de compilacion
- Console.WriteLine("Dame tu ecuación matemática: ");
- MatchCollection matches = Regex.Matches("98009", "[1-9]+[0-9]*",RegexOptions.IgnorePatternWhitespace);
- Console.WriteLine("Found {0} matches.", matches.Count);
- Calculadora calc = new Calculadora();
- Console.WriteLine(calc.CadenaAEvaluar(Console.ReadLine()));
- }
- }
- }
- ---------------------
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Data;
- namespace Calculadora{
- class Calculadora{
- DataTable dt;
- public Calculadora() {
- dt = new DataTable();
- }
- public String CadenaAEvaluar(String cadenaAEvaluar) {
- var v = dt.Compute(cadenaAEvaluar, "");
- return v.ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement