- #include<iostream> //引入標頭檔<iostream in& out stream>
- #include<cstdlib> //引入標頭檔<cstdlib> c standard library
- using namespace std; //指定命名空間 std
- int main() //主函式
- { //大括號內為主函式所要執行的程式碼
- //int x
- //int x
- //int y
- int x=23,y=7;
-
- 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給主控台告知程式已經成功執行
複製代碼 |