#include <iostream> using namespace std; int main(){ //后置递增 先计算在递增 int a1=1,b1=0; b1=b1+(a1++);//b1=1 cout<<"a1="<<a1<<endl; cout<<"b1="<<b1<<endl; //前置递增 先递增后计算 int a2=1,b2=0; b2=b2+(++a2); cout<<"a2="<<a2<<endl; cout<<"b2="<<b2<<endl; //后置递减 先计算后递减 int a3=1,b3=0; b3=b3+(a3--);//a3=0,b3=1 cout<<"a3="<<a3<<endl; cout<<"b3="<<b3<<endl; int a4=1,b4=0; b4=b4+(--a4);//a4=0,b4=0 cout<<"a4="<<a4<<endl; cout<<"b4="<<b4<<endl; return 0; }