static void Main(string[] args)
{
double a, b, c, Result;
while (true) // and is good idea to use while to keep backing to main ??
{
Console.WriteLine("\t\t\t\t\t\t\tCalcualtor");
Console.WriteLine("\t\t\t\t\t\t\t----------");
Console.WriteLine("put Number Plz");
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("put other Number Plz");
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Choose :*,+,-,/");
string uservalue = Console.ReadLine();
if (uservalue == "*")
{
Result = a * b;
Console.Write("Resultat= " + a * b);
}
else if (uservalue == "+")
{
Result = a + b;
Console.Write("Resultat= " + (a + b));
}
else if (uservalue == "-")
{
Result = a - b;
Console.Write("Resultat= " + (a - b));
}
else if (uservalue == "/")
{
Result = a/b;
Console.Write("Resultat= " + (a/b));
}
else
Console.WriteLine("put right operator !!!");
//我需要在這裏開始我已經做過的所有事情意味着循環即時仍然新與C#任何建議?完成計算後保持循環
Console.ReadLine();
Console.Clear();
}
}
}
}
好這個問題,我問它的時間以前,我不知道很多關於C#所以我已經解決它
我沒有看到一個問題呢,只是一串代碼。另外,不要使用'goto' – BradleyDotNET
問題是在別的我需要回到控制檯用戶值,所以我怎麼做? – Elmissouri
這不是一個連貫的問題。您已經打印了計算結果... – BradleyDotNET