結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,716 KB
testcase_01 AC 125 ms
55,808 KB
testcase_02 AC 125 ms
55,896 KB
testcase_03 AC 125 ms
55,956 KB
testcase_04 AC 125 ms
56,044 KB
testcase_05 WA -
testcase_06 AC 124 ms
55,780 KB
testcase_07 AC 127 ms
55,836 KB
testcase_08 AC 128 ms
55,804 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