C acmp 796 text formatting
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/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).From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill c-acmp-796-text-formattingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.9 KB, 562 tokens by cl100k_base, as published. Nobody here has run it
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
w(max line width, 5 ≤ w ≤ 100) andb(indent size, 1 ≤ b ≤ 8) from the first line. - 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
bspaces. - 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
wand indentb. - Write result to
OUTPUT.TXT.
Triggers
- решить задачу 796 acmp
- форматирование текста c#
- acmp text formatting
- c# text formatting problem
- acmp 796 solution
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.