- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int x=10,y=10;
-
-
- cout<<"請輸入X"<<endl;
- cin>>x;
- cout<<"請輸入Y"<<endl;
- cin>>y;
- 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;
- if(x>y)
- {
- cout<<"X>Y"<<endl;
- }
- else if(x<y)
- {
- cout<<"X<Y"<<endl;
- }
- if(x=y)
- {
- cout<<"X=Y"<<endl;
- }
-
- system("pause");
- return 0;
- }
複製代碼 |