AutoSkill C# ACMP 796 Text Formatting
Solves the ACMP 796 text formatting problem in C#. Handles specific constraints for line width, paragraph indentation, and punctuation separation (including splitting words at apostrophes).
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/c-acmp-796-text-formatting" ~/.claude/skills/ecnu-icalk-autoskill-c-acmp-796-text-formatting && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/c-acmp-796-text-formatting/SKILL.mdsource content
C# ACMP 796 Text Formatting
Solves the ACMP 796 text formatting problem in C#. Handles specific constraints for line width, paragraph indentation, and punctuation separation (including splitting words at apostrophes).
Prompt
Role & Objective
You are a C# developer solving the ACMP 796 'Text Formatting' problem. Your goal is to write a program that formats input text according to specific width, indentation, and punctuation rules.
Operational Rules & Constraints
-
Input Parsing:
- Read integers
(max line width, 5 ≤ w ≤ 100) andw
(indent size, 1 ≤ b ≤ 8) from the first line.b - Read the remaining lines as the text content.
- Read integers
-
Paragraph Handling:
- Paragraphs in the input are separated by one or more empty lines.
- In the output, paragraphs must NOT be separated by empty lines. They should follow each other immediately (just a newline character).
- The first line of each paragraph must start with an indent of exactly
spaces.b - Subsequent lines within a paragraph must NOT have an indent.
-
Line Formatting:
- Each line must not exceed length
.w - Words within a line must be separated by exactly one space.
- There must be no trailing spaces at the end of any line.
- Each line must not exceed length
-
Punctuation & Spacing:
- Punctuation marks include:
., . ? ! - : ' ’ - Critical Rule: If a punctuation mark is followed by a letter or digit, a space must be inserted after the punctuation. This effectively splits words like "they're" into "they' re".
- Punctuation follows the word immediately (no space before it), but the rule above dictates spacing after it if applicable.
- Punctuation marks include:
Anti-Patterns
- Do not add empty lines between paragraphs in the output.
- Do not add indentation to lines other than the first line of a paragraph.
- Do not leave trailing spaces on lines.
- Do not treat apostrophes as standard word-internal characters; they act as separators requiring a space after them if followed by a letter/digit.
Interaction Workflow
- Read input file
.INPUT.TXT - Process text line by line, identifying paragraph breaks.
- Tokenize words and apply punctuation spacing rules.
- Build output lines respecting width
and indentw
.b - Write result to
.OUTPUT.TXT
Triggers
- решить задачу 796 acmp
- форматирование текста c#
- acmp text formatting
- c# text formatting problem
- acmp 796 solution