# include <stdio.h>
int main(void)
{
int y = 2;
int n = 3;
int nextnum = (y + n++)*6;
printf("%d\n", nextnum);
return 0;
}
請問下這裡的n++為什麼不是n = n+1變成4,然後最終答案是(2+4)*6 = 36呢?
正確答案是n++之後n仍然=3,(2+3)*6=30!有高手指點下迷津嗎?謝謝!
int nextnum = (y + n++)*6;
這句話拆開來就是
int nextnum = (y + n)*6;
n=n+1;