> For the complete documentation index, see [llms.txt](https://docs.1l.lol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.1l.lol/computer-basics/computer-and-environment.md).

# 计算机基础与编程环境

### 计算机的基本组成

冯·诺依曼结构的计算机由五大部件组成：

* **运算器**：执行算术与逻辑运算
* **控制器**：指挥各部件协调工作
* **存储器**：存放程序和数据（内存、外存）
* **输入设备**：键盘、鼠标、扫描仪等
* **输出设备**：显示器、打印机等

CPU = 运算器 + 控制器，是计算机的核心。

### 计算机发展简史

1. 第一代：电子管计算机（1946 年 ENIAC）
2. 第二代：晶体管计算机
3. 第三代：集成电路计算机
4. 第四代：大规模集成电路计算机

计算机按照规模可分为巨型机、大型机、小型机、微型机（PC）、工作站等。

### 操作系统

* **Windows**：图形界面，使用广泛
* **Linux**：开源，多用于服务器
* **macOS**：苹果电脑专用

常见操作：文件的新建 / 复制 / 粘贴 / 删除 / 移动、软件安装与卸载。

### 集成开发环境（IDE）

以 **Dev-C++** 为例，常用操作：

1. **新建**：文件 → 新建 → 源代码（快捷键 Ctrl+N）
2. **编辑**：输入代码，注意中英文标点
3. **保存**：Ctrl+S，文件后缀为 `.cpp`
4. **编译**：把源代码翻译成机器码，快捷键 F9
5. **运行**：快捷键 F10，或编译运行 F11
6. **调试**：设置断点，单步执行，观察变量

> 编译（compile）是把整份源码一次性翻译；解释（interpret）是逐句翻译执行。C++ 是编译型语言。

### 第一个程序

```cpp
#include <iostream>
using namespace std;

int main() {
    cout << "Hello, GESP!" << endl;
    return 0;
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.1l.lol/computer-basics/computer-and-environment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
