阅读:526回复:0
i++与++i
++[搜狗百科] //先用后加与先加后用
int a = 7; int b = ++a; //int b = a += 1; int c = a++; //int c = a; a++; Console.WriteLine("{0} {1} {2}",a,b,c); //9 8 8 int i = 1; Console.WriteLine("{0} {1}",i++,i); //1 2 使用等价思维、反向推导验证等方法可以帮助你更深入理解~ |
|