返回列表 發帖
  1. #include<iostream>                                        //引入標頭檔<iostream   in& out stream>
  2. #include<cstdlib>                                       //引入標頭檔<cstdlib>  c standard library
  3. using namespace std;                                                          //指定命名空間 std
  4. int main()                                                                              //主函式
  5. {                                                              //大括號內為主函式所要執行的程式碼
  6.       //int x  
  7.       //int x   
  8.       //int y
  9.    int x=23,y=7;
  10.    
  11.    cout<<"x+y="<<x+y<<endl;
  12.    cout<<"x-y="<<x-y<<endl;
  13.    cout<<"x*y="<<x*y<<endl;
  14.    cout<<"x/y="<<x/y<<endl;
  15.    cout<<"x%y="<<x%y<<endl;
  16.     system("pause");                                                                  //畫面暫停
  17.     return 0;                                                 //回傳0給主控台告知程式已經成功執行
複製代碼

TOP

返回列表