Home > Net >  C # how to achieve the calculation data and judgment (addition, subtraction, multiplication, and div
C # how to achieve the calculation data and judgment (addition, subtraction, multiplication, and div

Time:09-15

In a text box to input a set of data:
For example:
(1 + 1) - 1=1
1>=1=true
1 * 1=1

Need is literally in the text box input can return the final results, you can use the script, but don't know how to call VB

CodePudding user response:

https://www.cnblogs.com/leischen/archive/2012/03/30/2425601.html

CodePudding user response:

https://blog.csdn.net/zanfeng/article/details/77836675

CodePudding user response:

 
Using System;
Using System. Collections. Generic;
using System.Data;

The namespace ConsoleApp1
{
Class Program
{
Public class Calculator
{
The static void Main (string [] args)
{
The string expression;
The Console. Write (" input formula: ");
Expression=Console. ReadLine ();
Console. WriteLine (new to the DataTable (). Compute (expression, null));
}
}
}
  •  Tags:  
  • C#
  • Related