程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> as-火柴問題Matches

as-火柴問題Matches

編輯:編程解疑
火柴問題Matches

Description

Zidane is a weird arithmetic expert. Unlike other mathematician, he loves using matches to represent numbers as illustrated in Fig.1.

Fig.1

One day Zidane “wrote”an equation on his desk and then went out. The equation was in “A + B = C” format. A, B, and C were numbers made up by matches. “+” and “=” were wrote in ink.

When Zidane came back after a lecture, he found out that somebody must have touched the equation and the equation became wrong! After promised a new toy, Zidane's son confessed that he had broken in the room and moved ONE match (not removed, that match was still in the equation). Given the wrong equation on his desk, can you help Zidane find the original one?

Note: Both the wrong and original equations may have numbers with leading zeros. And it is guaranteed that only ONE possible original equation exists.
Input

The input consists of several test cases. Each test case is a single line representing a wrong equation. Each wrong equation is in the format of “A + B = C” (A, B and C are all numbers), and consists of no more than 100000 characters.
Output

Output the original equation in a single line followed by 17 “*” for each test case.
Sample Input

0 + 7 = 9
9 + 80 = 8
Sample Output

8 + 1 = 9


8 + 00 = 8


最佳回答:


http://poj.org/problem?id=3932

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved