++x和x++

class MainClass
{
    static void Main()
    {
        double x;

        x = 1.5;
        Console.WriteLine(++x);
        Console.WriteLine(x);

        x = 1.5;
        Console.WriteLine(x++);
        Console.WriteLine(x);
    }
}

 

结果值为:
2.5
2.5


1.5
2.5

 

posted @ 2011-03-10 14:34  有容乃大  阅读(308)  评论(0编辑  收藏  举报