繁体   English   中英

为什么在Visual Studio c#控制台应用程序中立即将其关闭?

[英]Why does this close immediately in Visual Studio c# console application?

{
   class Program
   {
      static void Main(string[] args)
      {

          Console.WriteLine("press enter to contiune");

          //math tutorial 
          Console.WriteLine("5 + 3 = " + (5 + 3));
          Console.WriteLine("5 - 3 = " + (5 - 3));
          Console.WriteLine("5 * 3 = " + (5 * 3));
          Console.WriteLine("5 / 3 = " + (5 / 3));

          Console.ReadLine();
          // casting
          //boolian
          double Pi = 31.4;
          int intPi = (int)Pi;

          //Math Functions
          // Acos Asin Atan Atan2 Cos Cosh Exp Log Sin Sinh Tan Tanh

          double num1 = 10.5;
          double num2 = 15;
          Console.WriteLine("Math.Max(num1, num2)" + Math.Max(num1, num2));
          Console.WriteLine("Math.Min(num1, num2)" + Math.Max(num1, num2));
          // other options: Abs Ceiling Floor Pow Round Sqrt

          Console.ReadLine();
      }
   }
}

//使用f5调试只是说按Enter键。//真的不确定无法找到解决方案

你可以尝试一下

在Visual Studio中:选择“ 调试”菜单,选择“ 选项和设置” ,在“ 调试/常规”节点内,清除“ 仅启用我的代码”

稍后,在发布模式下编译您的解决方案并执行它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM