5556: Batting Average打击率(ABC274A)
题目描述
Xiaoniui is making a computer baseball game.
He will write a program that shows a batter's batting average with a specified number of digits.
There are integers $A$ and $B$, which satisfy $1 \leq A \leq 10$ and $0 \leq B \leq A$.
Let $S$ be the string obtained as follows.
- Round off $\dfrac{B}{A}$ to three decimal digits, then write the integer part ($1$ digit), `.` (the decimal point), and the decimal part ($3$ digits) in this order, with trailing zeros.
For example, if $A=7$ and $B=4$, then $\dfrac{B}{A} = \dfrac{4}{7} = 0.571428\dots$ rounded off to three decimal digits is $0.571$. Thus, $S$ is `0.571`.
Constraints:
- $1 \leq A \leq 10$
- $0 \leq B \leq A$
- $A$ and $B$ are integers.
小牛正在制作一个电脑棒球游戏。他将编写一个程序,以指定的位数显示击球手的打击率。
给定整数A和B,满足1< A < 10和0 < B< A。让S为按以下方式获得的字符串:
将B/A四舍五入到小数点后三位,然后按顺序写出整数部分(1位)、。(小数点)和小数部分(3位),包括尾随零。
例如,如果A=7月B=4,则 B/A = 4/7 =0.571428...四舍五入到小数点后三位是0.571。因此, $S$为”0.571”。
数据范围:
- $1 \leq A \leq 10$
- $0 \leq B \leq A$
- $A$ 和$B$ 都是整数。
输入
输出
Print $S$ in the format specified in the Problem Statement. **Note that answers in different formats will be considered wrong.**
输出所求的S,请注意,不同格式的答案将被视为错误。
样例输入 复制
7 4
样例输出 复制
0.571