結果

問題 No.858 わり算
ユーザー shigeki_createshigeki_create
提出日時 2019-08-15 03:03:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 2,314 ms
コンパイル使用メモリ 76,588 KB
実行使用メモリ 57,812 KB
最終ジャッジ日時 2023-10-19 18:27:10
合計ジャッジ時間 4,470 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
57,636 KB
testcase_01 AC 158 ms
57,792 KB
testcase_02 AC 158 ms
57,788 KB
testcase_03 AC 158 ms
57,704 KB
testcase_04 AC 159 ms
57,812 KB
testcase_05 AC 157 ms
57,764 KB
testcase_06 AC 155 ms
57,700 KB
testcase_07 AC 155 ms
57,760 KB
testcase_08 AC 155 ms
57,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long A = sc.nextLong();
		long B = sc.nextLong();

		print(A/B + ".");

		A = A - A/B*B;

		for(int i=0; i<50; i++) {
			A = A*10;
			int result = (int) (A/B);
			print(result);
			A = A - result*B;
		}
	}

	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
}
0