提交时间:2020-10-31 19:48:43

运行 ID: 8369

package bb; import java.util.Scanner; public class 求小数n位后3个数 { static long a, b, n; static void getInput() { Scanner sc = new Scanner(System.in); a = sc.nextLong(); b = sc.nextLong(); n = sc.nextLong(); sc.close(); } static void calc() { long _扩大倍数 = (long) Math.pow(10, (n - 1) + 3); long _a扩大后 = a * _扩大倍数; long _商 = _a扩大后 / b; long _后三位 = _商 % 10; System.out.println(_后三位); } public static void main(String[] args) { getInput(); calc(); } }