奇妙的自增和分割符
1 #include<stdio.h> 2 int main(){ 3 int a=7,b=7,c; 4 c=a++ + ++b; 5 //a=8 b=8 6 printf("%d %d %d \n",a,b,c); 7 c=(++a,b++,a++,++b); 8 //a=9,b=9,a=10,b=10 9 //因为最后++b是先变成10再赋值的,所以c=10 10 printf("a = %d,b = %d,c = %d\n",a,b,c); 11 12 c=(++a,++b,a++,b++); 13 //a=11,b=11,a=12,b=12; 14 //因为最后b++是先赋值在变成12的,所以c=11 15 printf("a = %d,b = %d,c = %d\n",a,b,c); 16 return 0; 17 }