類 尋找類似 int Result;
DataTable dt2 = new DataTable();
var v = dt2.Compute("3+2-34*12", "");
Result=Convert.ToInt32(v); 上面的代碼,它解決了文本基礎公式。不幸的是,上面的代碼只適用於一些基本的運算符(+, - ,/,*)。需要更復雜一點(比如squareroot,^至
這是Text Based Basic Formula Calculator Function/Class 我一直在使用一個簡單的數學公式爲2^3,你用Microsoft.CodeAnalysis.CSharp如下所示嘗試了跟進的問題。腳本: using System;
using System.Collections.Generic;
using System.Linq;
using Sys
我目前正在編寫一個簡單的骰子游戲,並遇到一個讓我困惑的錯誤,這是我的碼。 foreach (var die in Dice.rolls)
{
Console.WriteLine(die.ToString());
}
if (player.score += score >= goal)
{
playing = false;
Console.WriteLine("