- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main ()
- {
- int x = 21;
- int y = 5;
- cout <<"當 x = "<< x << " ,y = "<<y<<"時"<<endl;
- cout <<" x + y = " << x+y <<endl;
- cout <<" x - y = " << x-y <<endl;
- cout <<" x * y = " << x*y <<endl;
- cout <<" x / y = " << x/y <<endl;
- cout <<" x % y = " << x%y <<endl;
- system("pause");
- return 0;
- }
複製代碼 |