#P1149. [NOIP 2008 提高组] 火柴棒等式
[NOIP 2008 提高组] 火柴棒等式
Description
Given matchsticks, how many equations of the form can you make? In the equation, , , and are integers formed with matchsticks (if the number is nonzero, its most significant digit cannot be ). The ways to form the digits to with matchsticks are shown in the figure:

Note:
- The plus sign and the equals sign each require two matchsticks.
- If , then and are considered different equations ().
- All matchsticks must be used.
Input Format
A single integer ().
Output Format
A single integer, the number of different equations that can be formed.
14
2
18
9
Hint
[Explanation for Sample 1]
The equations are and .
[Explanation for Sample 2]
The equations are , , , , , , , , .
NOIP 2008 Senior Problem 2.
Translated by ChatGPT 5
京公网安备 11011102002149号