> For the complete documentation index, see [llms.txt](https://roychanghua.gitbook.io/cpp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roychanghua.gitbook.io/cpp/ling-shi/ban-hello-world.md).

# 進階版 Hello, World!

目標：

* [ ] 和其他人問好
* [ ] 學會cin

### Step 1:

先在程式碼中打好基礎架構 （請參[第一個c++程式碼](https://roychanghua.gitbook.io/cpp/ling-shi/di-yi-c++-cheng-shi) Step 1)

### Step 2:

在main函式中加入以下程式碼

```cpp
string s;
cin >> s;
cout << "Hello, " << s ;
```

### Step 3:

完成

詳細解析

```
string s;
```

string 我們稱為「資料型別」，s則稱為「變數」

所謂變數，就像是數學中的 $$x$$ ，$$x$$可以是1, 2, 3, 0,8 ..，和數學不同的是，我們必須規定 $$x$$ 的種類，在這邊，我們規定變數 s 必須是字串（string），而字串又是什麼？參考以下連結吧ＸＤ&#x20;

請參考[這篇](https://www.csie.ntu.edu.tw/~b98902112/cpp_and_algo/cpp/variable_type_and_declare.html)

ps. 點進連結後，就跟著那個網頁繼續學吧\~
