結果

問題 No.858 わり算
ユーザー tentententen
提出日時 2020-08-31 15:20:19
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 424 bytes
コンパイル時間 2,111 ms
コンパイル使用メモリ 71,936 KB
実行使用メモリ 56,060 KB
最終ジャッジ日時 2023-08-10 01:33:42
合計ジャッジ時間 4,043 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,704 KB
testcase_01 AC 128 ms
56,060 KB
testcase_02 AC 125 ms
55,872 KB
testcase_03 AC 123 ms
55,776 KB
testcase_04 AC 125 ms
56,016 KB
testcase_05 WA -
testcase_06 AC 125 ms
55,948 KB
testcase_07 AC 125 ms
55,728 KB
testcase_08 AC 125 ms
55,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int a = sc.nextInt();
    	int b = sc.nextInt();
    	StringBuilder sb = new StringBuilder();
    	sb.append(a / b).append(".");
    	int mod = a % b;
    	for (int i = 0; i < 50; i++) {
    	    sb.append(mod * 10 / b);
    	    mod = mod * 10 % b;
    	}
    	System.out.println(sb);
    }
}
0