Skip to main content
Prompts C++ Efficient Solver with Compact Styling

developer coding user risk: low

C++ Efficient Solver with Compact Styling

Instructs solving a programming question in C++ using namespace std in a simple, highly efficient way. Requires code styling with no comments, no spaces between operators and opera…

PROMPT

SOLVE THE QUESTION IN CPP, USING NAMESPACE STD, IN A SIMPLE BUT HIGHLY EFFICIENT WAY, AND PROVIDE IT WITH THIS RESTYLING:
no comments, no space between operator and operand but proper margin and indentation, brackets open on the next line always and do not forget to rename variables as short as possible, possibly alphabets

REQUIRED CONTEXT

  • programming question

ROLES & RULES

  1. Solve the question in C++.
  2. Use namespace std.
  3. Make it simple but highly efficient.
  4. Provide no comments.
  5. No space between operator and operand.
  6. Use proper margin and indentation.
  7. Open brackets on the next line always.
  8. Rename variables as short as possible, possibly alphabets

EXPECTED OUTPUT

Format
code
Constraints
  • no comments
  • no space between operator and operand but proper margin and indentation
  • brackets open on the next line always
  • rename variables as short as possible possibly alphabets
  • using namespace std

SUCCESS CRITERIA

  • Solve in C++ using namespace std
  • Ensure simple and highly efficient
  • Apply specified restyling exactly

FAILURE MODES

  • Adding comments
  • Using spaces between operator and operand
  • Long variable names
  • Incorrect bracket placement
  • Poor indentation
  • Inefficient code
  • Not using namespace std

CAVEATS

Dependencies
  • Requires the specific question to solve
Missing context
  • The specific programming problem or question to solve.
  • Expected input/output specifications.
  • C++ standard version (e.g., C++11, C++17).
  • Whether a full program with main() or a function/snippet is required.
Ambiguities
  • 'THE QUESTION' is not specified or provided.
  • 'proper margin and indentation' is vague and undefined.
  • 'highly efficient' lacks quantifiable criteria.

QUALITY

OVERALL
0.40
CLARITY
0.60
SPECIFICITY
0.70
REUSABILITY
0.30
COMPLETENESS
0.20

IMPROVEMENT SUGGESTIONS

  • Introduce a clear placeholder for the problem, e.g., 'SOLVE THE FOLLOWING QUESTION IN C++: {question}'.
  • Rewrite in sentence case with proper punctuation and structure for readability.
  • Define 'proper margin and indentation', e.g., 'Use 4 spaces for indentation and one space between statements.'.
  • Specify if output should include #include directives and int main().
  • Add examples of desired variable renaming and bracket style.

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR DEVELOPER