A higher resolution is required to access the IDE
- 26
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Goal
You are prerendering an HTML string from C99 code. You have already done the extraction part, what is left to do is to simulate the escape sequences of every step until you obtain the final document.The steps to do so are the following:
Step 1. Process C-style trigraphs, i.e. three-character sequences starting with
*
*
*
*
*
*
*
Step 2. Process escape sequences starting with
*
*
*
*
Note: Hexadecimal characters can be provided uppercase or lowercase, and all codes, even using \U, will be contained within the ASCII range, i.e. between 1 and 127 included.
Step 3. Process some HTML entities, using the following formats:
*
*
Only the following entity names should be supported:
*
*
*
*
If an entity name is not found, the HTML entity code should be rendered literally, i.e.
Note: All codes represented using
Input
First line: text to process.
Output
First line: Processed text.
Constraints
0 < length(text) < 500
Example
Input
Some very old keyboards lack necessary characters to program in C, such as ??=, ??', ??(??), ??! and ??-.
Output
Some very old keyboards lack necessary characters to program in C, such as #, ^, [], | and ~.
A higher resolution is required to access the IDE