# print系列函数

## 格式化打印

打印由各种I/O流函数处理。人们应该要知道如何去使用它们。

* `print`：用于将文本打印到不带换行符的输出流。
* `println`：与`print`相同，但它会自动追加换行符。
* `eprint`：与`print`相同，但它会输出到错误流（stderr）。
* `eprintln`：与`println`相同，不过它会输出到错误流（stderr）。
* `panic`：程序的输出和退出。

```
print('Hello World')
print('Hello V')
```

它在屏幕上将会打印 `Hello WorldHello V`

如果要在新行上打印下一行，则必须执行`\n`。

```
print('Hello World \n')
print('Hello V ')
```

如果不想使用`\n`，则可以使用`println`。

## 注释

V支持单行注释`//`和多行注释`/**/`。 它们应该用于记录代码，以便让其他用户知道代码是如何工作的。 它还可以用于临时注释代码，以后不得不使用。

```
// 这是单行注释

/* 这是
*  多行注释
* /* 这也可以嵌套*/
*/
```

### 练习

尝试在`hello.v`中删掉代码的注释，看看会发生什么。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://v-community.gitbook.io/v-by-example/cn/examples/section_1/hello_world.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
