【poj】里的智力题
来源:互联网 发布:公务员部门排名知乎 编辑:程序博客网 时间:2024/04/30 16:52
Matches
Time Limit: 5000MS Memory Limit: 65536KTotal Submissions: 183 Accepted: 19
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.
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 = 99 + 80 = 8
Sample Output
8 + 1 = 9*****************8 + 00 = 8*****************
待续
0 0
- 【poj】里的智力题
- 智力题解题报告 No.19 苹果里里的五角星
- 智力题 :12个乒乓球的智力题
- 几个有趣的智力题
- 经典的智力题
- 我搜集的智力题
- 网上的智力题
- google的智力题
- 一道小小的智力题
- 一道古老的智力题
- 古老的智力题
- 爱因斯坦的智力题
- 智力题的思考
- 有趣的智力题
- 简单的智力题集合
- 很好的智力题
- 有趣的一些智力题
- 有趣的面试智力题
- ParalellMultiSearcher : 多线程搜索源代码
- 数据结构实验之链表六:有序链表的建立
- 教你实现Winform窗体的四边阴影效果
- ZOJ 3635 Cinema in Akiba(线段树)
- Unity3d动画脚本 Animation Scripting(深入了解游戏引擎中的动画处理原理)
- 【poj】里的智力题
- Oracle定时任务dbms_scheduler
- 软件架构师应具备的十大特点
- 冒泡升序排序的数组实现和链表实现
- 生产者/消费者模式
- 【Button美化】五分钟带你入门GDI+重绘组件
- vijos 1680 P1680 距离 ( 线性dp )
- acd - 1216 - Beautiful People(二维LIS)
- Serif和Sans-serif字体的区别