# 1.1 入门

在《krc-2e》中文版里讲到这句话，学习一门新程序设计语言的唯一途径就是使用它编写程序。对于所有语言的初学者来说，编写的第一个程序几乎是相同的。

{% code title="1.1.1 main.c" lineNumbers="true" %}

```c
#include <stdio.h>
int main()
{
    return 0;
}
```

{% endcode %}

{% code title="1.1.2 hello.c" lineNumbers="true" %}

```c
#include <stdio.h>  //打招呼 
int main()
{
    printf("xxx");
    return 0;
}
```

{% endcode %}

printf() 函数，是库里的，而不是 c 语言本身自带的，那就需要给库里放 printf() 函数的老大爷，打个招呼。

```
<stdio.h> std  standard 标准 io 输入输出
```

从生活化的角度学习 c 语言是一个不错的角度。

这里提到一个 转义字符序列  为表示无法输入的字符或不可见字符提供了一种机制（详见 p3）。

{% code title="1.1.3 hello.c" lineNumbers="true" %}

```c
#include <stdio.h>  //打招呼 
int main()
{
    printf("xxx\n");
    return 0;
}
```

{% endcode %}


---

# 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://labspc.gitbook.io/cnippets/chap1.-dao-yan/1.1-ru-men.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.
