1992.Old Bill

通过数:13提交数:14学校:上海交通大学保研机试真题 题目列表 标签
题目描述 Among grandfather's papers a bill was found: "$72$ turkeys $ 679 $" The first and last digits of the number representing the total price are faded (denoted by $\ $). What are the two faded digits and what was the price per turkey? We want to write a program that solves a general version of this problem: "$N$ turkeys $ XYZ $" $N$ (number of turkeys) is between $1$ and $99$ (inclusive) The total price originally had $5$ digits, but only the middle $3$ digits ($X$, $Y$, $Z$) are visible The first digit is nonzero Each turkey costs the same integer price Given $N$, $X$, $Y$, $Z$, find the two faded digits and the original total price. If multiple solutions exist, choose the most expensive one (maximum price per turkey). 输入格式 The first line contains integer $N$ ($0 < N < 100$). The second line contains three digits $X$, $Y$, $Z$ separated by spaces (representing the middle three digits of the total price). 输出格式 Output the two faded digits (first and last) followed by the maximum price per turkey (integer). 输入样例 72 6 7 9 输出样例 3 2 511
C
补全
点击调试按钮即可调试代码。

点击提交按钮即可提交代码。