自加(++)的问题

Posted on 2023-10-22,1 min read

#include 
using namespace std;
int main() 
{
    int a = 1, b = 2, c = 3, d = 4;
    a = b++;//a先等于b,b再自加
    cout << a << " " << b << endl;
    c = ++d;//d先自加,c再等于d
    cout << c << " " << d << endl;
    return 0;
}

下一篇: 分别接收一串字符→