- #include <iostream>
- using namespace std;
- int main(int argc, char** argv)
- {
- float a,b,c,d,x=6;
- int f=20;
- a=b=c=d=float(f);
-
- cout<<"a = b = c = d = f = 20, x = 6"<<endl
- <<"a += x => a = "<<(a += x)<<endl
- <<"b -= x => b = "<<(b -= x)<<endl
- <<"c *= x => c = "<<(c *= x)<<endl
- <<"d /= x => d = "<<(d /= x)<<endl
- <<"f %= x => f = "<<(f %= 6);
-
- return 0;
- }
複製代碼
- #include <iostream>
- using namespace std;
- int main(int argc, char** argv)
- {
- int a,b,c,d;
- int x=6;
- int f=20;
- a=b=c=d=f;
-
- cout<<"a = b = c = d = f = 20, x = 6"<<endl
- <<"a += x => a = "<<(a += x)<<endl
- <<"b -= x => b = "<<(b -= x)<<endl
- <<"c *= x => c = "<<(c *= x)<<endl
- <<"d /= x => d = "<<(d /= x)<<endl
- <<"f %= x => f = "<<(f %= x);
-
- return 0;
- }
複製代碼
|