参考该博主知识点的介绍https://blog.csdn.net/weixin_45856549/article/details/103169599?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_utm_term~default-1.pc_relevant_aa&spm=1001.2101.3001.4242.2&utm_relevant_index=4。我进行了试验
void main()
{
int x = 5;
//cout << x++ << endl;
cout << 2 * x++ << endl << 3 - ++x;//▲▲▲
int y = 1;
int u = 1;
//int q = 2 * ++y;
//cout << "\nthe value of q = " << q << endl;
cout << endl << 2 * ++y << endl;
//int w = 2 * u++;
//cout << "the value of w = " << w << endl;
cout << 2 * u++ << endl;
}
运行结果
12
-4
4
2
