返回列表 發帖

我的第一支程式

本帖最後由 tonyh 於 2016-7-13 13:37 編輯

在螢幕上顯示 hello 字樣.
  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.     cout<<"123"<<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<<"123"<<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

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

TOP

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.      cout<<"OH MY GOD"<<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

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     cout <<"How amazing it is!"<<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<<"oh"<<endl;
  7.     system("pause");
  8.    cout<<"my"<<endl;
  9.     system("pause");
  10.    cout<<"god"<<endl;
  11.     system("pause");

  12. return 0;
  13. }
複製代碼

TOP

回復 1# tonyh
  1. #include<iostream>  
  2. #include<cstdlib>  
  3. using namespace std;
  4. int main()
  5. {
  6. cout<<"rock"<<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<<"lego star wars"<<endl;
  7.       system("pause");
  8.       return 0;  
  9. }
複製代碼

TOP

本帖最後由 康睿群 於 2016-7-12 20:17 編輯
  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

  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

  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6.     cout<<"How are you" <<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

  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6. cout<<"hello"<<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<<"o"<<endl;
  7.     system("pause");
  8.     cout<<"h"<<endl;
  9.     system("pause");
  10.      cout<<" "<<endl;
  11.     system("pause");  
  12.     cout<<"m"<<endl;
  13.     system("pause");
  14.     cout<<"y"<<endl;
  15.     system("pause");
  16.      cout<<" "<<endl;
  17.     system("pause");
  18.    cout<<"g"<<endl;
  19.     system("pause");
  20.     cout<<"o"<<endl;
  21.     system("pause");
  22.     cout<<"d"<<endl;
  23.     system("pause");

  24. return 0;
  25. }
複製代碼

TOP

返回列表