# Kobe2ST **Repository Path**: KOBEEVER/Kobe2ST ## Basic Information - **Project Name**: Kobe2ST - **Description**: Command-line English text counting tool (wc.exe) - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-10-25 - **Last Updated**: 2026-10-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # wc-homework 命令行纯英文文本计数统计工具(C 语言实现)。 ## 一、项目简介与用法 wc.exe 可以统计纯英文 txt 文本中的字符数、单词数、句子数,并支持统计源码文件中的代码行、空行、注释行。 命令格式: ```text wc.exe [参数] [文件名] ``` 参数说明: | 参数 | 含义 | | --- | --- | | -c | 统计字符数(不含换行) | | -w | 统计单词数 | | -s | 统计句子数 | | -l, --lines | 统计总行数 | | -d, --code | 统计代码行数 | | -e, --empty | 统计空行数 | | -n, --comment | 统计注释行数 | | -a, --all | 显示全部统计结果 | | -h, --help | 显示帮助信息 | 编译方式: ```text gcc -std=c11 -Wall -Wextra -O2 -o wc.exe wc.c count.c gcc -std=c11 -Wall -Wextra -O2 -o test_wc.exe tests/test_wc.c count.c ``` ## 二、文件列表 | 文件 | 说明 | | --- | --- | | wc.c | 程序入口,负责命令解析与文件读取 | | wc.h | 统计接口与结构体定义 | | count.c | 字符、单词、句子及代码行统计实现 | | tests/test_wc.c | 单元测试 | | sample.txt | 纯英文文本测试样例 | | sample_code.c | 源码测试样例 | | docs/screenshots/ | 运行结果与测试截图 | ## 三、例程运行与结果 纯英文文本统计: ```text > wc.exe -a sample.txt Characters: 46 Words: 10 Sentences: 3 Total lines: 2 Code lines: 2 Empty lines: 0 Comment lines: 0 ``` 源码统计: ```text > wc.exe -a sample_code.c Characters: 141 Words: 22 Sentences: 1 Total lines: 10 Code lines: 5 Empty lines: 2 Comment lines: 3 ``` 运行截图: ![运行结果](docs/screenshots/run-tests.png) ![帮助信息](docs/screenshots/help.png) 单元测试: ```text > test_wc.exe All tests passed. ``` ![单元测试](docs/screenshots/unit-test.png) ## 版本记录 - v0.1 空项目 - v0.2 完成基础功能 - v0.3 完成扩展功能