- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- //五則運算
- //int x;
- //int y;
- int x=23,y=7;
-
- 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;
- }
-
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- //五則運算
- //int x;
- //int y;
- int x=23,y=7;
-
- 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;
- }
-
複製代碼 |