Skip to main content

輸出

使用 cout 輸出資料到標準輸出

在 Code::Blocks 裡建立一個專案後,它會自動產生這樣一個程式架構。

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

其中的 main() 稱為主函數,

int main()
{
    // 要做的事情寫在這裡面
}