- #include<iostream> // IO
- #include<cstdlib> // Library
- 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; //回傳0至主控台,告知程式已成功結束
- }
複製代碼 |