• [1146] Ancient String

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • There are two ancient stone tablet.
    Two strings were written on one ancient stone tablet.
    Each string only contains digits with a minus sign at the middle. What's magical is that the string is palindrome.
    For example:
    91720-02719
    Another stone tablet is the key to some buried treasure. It contains two numbers - The results of the two string formulas on the previous tablet.
    But what a pity, the palindrome table is missing and an other table is smeared.
    For finding the treasure, you should identify the two numbers because the key is the sum of these two numbers.
  • 输入
  • This problem contains several cases.
    Each case has two strings (Longer than 2 but no longer than 9, without leading zero), indicates two smeared numbers. The smeared digit is a '*'. You can consider there's only one '*' in each number.
  • 输出
  • For each case, you should output the key. You can assume that the key is unque. No zero or nine will be smeared.
  • 样例输入
  • *9001 6*934
    
  • 样例输出
  • 154935
    
  • 提示
  • 91720-02719 will be 89001, it will match the first number.
    87212-21278 will be 65934, it will match the second number.
    So their sum is 154935.
    
  • 来源
  • XadillaX
  • 操作

显示春菜