(C语言)每日代码||2023.12.27||关于(++i)+(++i)以及(++i)+(i = 100)
#include <stdio.h>
int main() {
int i = 1;
int a = (++i) + (++i);
printf("a = %d,i = %d\n", a, i);//a = 6,i = 3
i = 1;
a = (++i) + (i = 100);
printf("a = %d,i = %d\n", a, i);//a = 200,i = 100
i = 1;
a = (i++) + (i++);
printf("a = %d,i = %d\n", a,i);//a = 2,i = 3
i = 1;
a = (i++) + (i = 100);
printf("a = %d,i = %d\n", a, i);//a = 200,i = 101
}
运行环境VS C语言标准 默认(旧MSVC)