返回列表 發帖

我的第一個程式

  1. #include<iostream>     //引入 <基本輸入輸出> 標頭檔 in & out stream
  2. #include<cstdlib>      //引入 <標準函式庫> 標頭檔 c standard library
  3. using namespace std;   //指定命名空間為 std
  4. int main()    //主函式
  5. {
  6.     cout<<"hello"<<endl;   //cout輸出  endl換行
  7.     system("pause");       //讓畫面暫停
  8.     return 0;              //回傳0到主控台,告知該程式已成功執行
  9. }
複製代碼

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.    
  7.     cout<<"我是依宸"<<endl;
  8.    
  9.     system("pause");
  10.     return 0;   
  11.    
  12.    
  13. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     cout<<"白帥帥" ;
  7.     system("pause");
  8.     return 0 ;
  9. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main ()
  5. {
  6.     cout<<"我是譚詩澐"<<endl;
  7.     system ("pause");
  8.     return 0;
  9. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     cout<<"我是陳柏霖"<<endl;
  7.     system("pause");
  8.     return 0;
  9. }
複製代碼

TOP

本帖最後由 陳杏宜 於 2018-3-24 20:27 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     cout<<"我是陳杏宜"<<endl;  
  7.    system("pause");
  8.    return 0 ;           
  9.                  
  10. }
複製代碼

TOP

  1. #include<iostream>   // 引入輸入輸出的標頭檔      // => 註解
  2. #include<cstdlib>    // c++ standard library  引入c++標準函式庫
  3. using namespace std; // namespace命名空間  
  4. int main()     //主函式
  5. {
  6.    cout<<"hello world"<<endl;  // cout輸出文字在畫面上 , endl 換行
  7.    system("pause");  // 執行畫面停留
  8.    return 0;  // 執行完成
  9. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     cout<<"bye"<<endl;
  7.     system("pause");
  8.     return 0;
  9.    
  10.    
  11. }
複製代碼

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     cout<<"hello pig"<<endl;
  7.     system("pause");
  8.     return 0;
  9.    
  10.    
  11. }
複製代碼

TOP

  1. #include<iostream>   //input&output
  2. #include<cstdlib>  //standardliburary
  3. using namespace std;
  4. int main()  //主函式
  5. {
  6.    cout<<"hello "<<endl;
  7.     system("pause");
  8.     return 0;
  9. }      
複製代碼

TOP

返回列表