⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 increment.cs

📁 this is a good book for the visual c#
💻 CS
字号:
// Fig. 4.14: Increment.cs
// Preincrementing and postincrementing

using System;

namespace Increment
{
   /// <summary>
   /// Summary description for Class1.
   /// </summary>
   class Increment
   {
      /// <summary>
      /// The main entry point for the application.
      /// </summary>
      [STAThread]
      static void Main(string[] args)
      {         
         int c;
   
         c = 5;
         Console.WriteLine( c );   // print 5
         Console.WriteLine( c++ ); // print 5 then postincrement
         Console.WriteLine( c );   // print 6

         Console.WriteLine();      // skip a line

         c = 5;
         Console.WriteLine( c );   // print 5
         Console.WriteLine( ++c ); // preincrement then print 6
         Console.WriteLine( c );   // print 6s
      
      } // end of method Main
   
   } // end of class Increment
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -