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);
}
}
}
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);
}
}
}
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();
为什么加上它就可以,它是用来接受值的吗?
是这句int x = 10, y = 10,z;
变量要先声明在使用的,int x = 10; y= 10; 实际上只声明了X~