using System;
using System.Collections.Generic;
using System.Text;namespace ConsoleApplication12
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = 10; y= 10;
            z = x++;
            Console.WriteLine("gu ji z=10 ,z={0}",z);
            z = ++y;
            Console.WriteLine("gu ji z=11,z={0}",z);
        }
    }
}

解决方案 »

  1.   


               int x = 10; y= 10; 
                z = x++; 
                Console.WriteLine("gu ji z=10 ,z={0}",z); 
                z = ++y; 
                Console.WriteLine("gu ji z=11,z={0}",z); 
    改成这样               int x = 10, y = 10,z;
                    z = x++;
                    Console.WriteLine("gu ji z=10 ,z={0}", z);
                    z = ++y;
                    Console.WriteLine("gu ji z=11,z={0}", z);
                    Console.ReadLine();
      

  2.   

    Console.ReadLine();
    为什么加上它就可以,它是用来接受值的吗?
      

  3.   

    Console.ReadLine(); 是接收一个从控制台输入的字符,其实不加程序是可以运行的,只是一闪就过去了,我是为了方便查看才加的
      

  4.   

    不是因为加上Console.ReadLine()吧,这条语句是为了保持输出窗口不关闭(回车即可停止程序)
    是这句int x = 10, y = 10,z;
    变量要先声明在使用的,int x = 10; y= 10; 实际上只声明了X~