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