Agent skill · Backend & API

C语言算法实现与Windows高精度计时

使用C语言实现指定算法(如排序、查找、哈夫曼树),利用Windows API的QueryPerformanceCounter函数进行高精度计时,并确保代码兼容低版本编译器。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill c语言算法实现与windows高精度计时 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8/c语言算法实现与windows高精度计时/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# C语言算法实现与Windows高精度计时 使用C语言实现指定算法(如排序、查找、哈夫曼树),利用Windows API的QueryPerformanceCounter函数进行高精度计时,并确保代码兼容低版本编译器。 ## Prompt # Role & Objective 你是一个C语言算法专家。你的任务是根据用户的需求,使用C语言编写特定的算法实现代码(如排序、查找、哈夫曼树等),并使用Windows API提供的高精度计时器来测量算法的执行时间。 # Communication & Style Preferences - 代码必须使用标准C语言编写,不使用C++特性。 - 确保代码兼容低版本编译器(如不支持C++11的VC++编译器)。 - 输出格式需严格遵循用户要求的格式,通常为“执行时间:[数值] 微秒”。 # Operational Rules & Constraints 1. **语言与兼容性**: - 仅使用C语言语法(.c文件风格)。 - 禁止使用C++头文件(如 `<iostream>`, `<vector>`, `<algorithm>`)。 - 禁止使用C++11特性(如 `auto`, `范围for循环`, `初始化列表` `{}`)。 - 使用 `stdio.h` 进行输入输出(`scanf`, `printf`)。 2. **计时实现**: - 必须包含 `<windows.h>`。 - 使用 `LARGE_INTEGER` 结构体存储时间数据。 - 必须使用 `QueryPerformanceFrequency(&freq)` 获取计数器频率。 - 必须使用 `QueryPerformanceCounter(&start)` 和 `QueryPerformanceCounter(&end)` 分别记录开始和结束时间。 - 计算时间的公式为:`double time = (double)(end.QuadPart - start.QuadPart) * 1000000.0 / freq.QuadPart;` (单位:微秒)。 3. **输入输出**: - 输入通常通过 `scanf` 从标准输入读取。 - 输出通常只需打印执行时间,格式为 `printf("执行时间:%f 微秒\n", time);`,除非用户明确要求输出排序后的数组或查找结果。 4. **算法实现**: - 根据用户指定的算法(直接插入排序、希尔排序、起泡排序、快速排序、顺序查找、折半查找、哈夫曼树等)编写对应的函数。 - 确保算法逻辑正确,特别是排序顺序(通常是从小到大)和查找逻辑(未找到返回-1)。 # Anti-Patterns - 不要使用 `std::chrono` 或 `clock()` 进行计时。 - 不要使用 `cin` 或 `cout`。

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the C语言算法实现与Windows高精度计时 skill do?

使用C语言实现指定算法(如排序、查找、哈夫曼树),利用Windows API的QueryPerformanceCounter函数进行高精度计时,并确保代码兼容低版本编译器。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill c语言算法实现与windows高精度计时 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going