- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main() //int ---> integer 整數
- {
- int x,y;
- cout<<"輸入x的值:";
- cin>>x;
- cout<<"輸入y的值:";
- cin>>y;
-
-
- 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;
- }
複製代碼 |