返回列表 回复 发帖
我看了程序,没有觉得不正常地方。我根据程序简单的说一下。

cin>>x;                         x=8
        cin>>y;                 y=4

        cout<<"x+y="<<(x+=y)<<endl;   x=x+y=8+4=12
        cout<<"x-y="<<(x-=y)<<endl;    x=x-y=12-4=8
        cout<<"x*y="<<(x*=y)<<endl;   x=x*y=8*4=32
        cout<<"x/y="<<(x/=y)<<endl;    x=x/y=32/4=8
        cout<<"x%y="<<(x%=y)<<endl;   x=x%y=8%4=0
        cout<<"x<<y="<<(x<<=y)<<endl;  x=x<<y=0<<4=0
        cout<<"x>>y="<<(x>>=y)<<endl;  x=x>>y=0>>4=0
        cout<<"x^y="<<(x^=y)<<endl;    x=x^y=0^4=4
        cout<<"x=y="<<(x=y=100)<<endl; x=y=100


如果你对其中那一个部分不清楚,你提出来。我具体给你说一下。
3# moorwindmill


哦。以后有问题,可以直接在论坛中提出。
返回列表