結果

問題 No.858 わり算
ユーザー tentententen
提出日時 2022-09-13 17:27:48
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,221 bytes
コンパイル時間 4,450 ms
コンパイル使用メモリ 74,704 KB
実行使用メモリ 49,900 KB
最終ジャッジ日時 2023-08-20 19:11:58
合計ジャッジ時間 3,417 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
49,180 KB
testcase_01 AC 46 ms
49,232 KB
testcase_02 AC 47 ms
49,548 KB
testcase_03 AC 46 ms
49,064 KB
testcase_04 AC 52 ms
49,184 KB
testcase_05 WA -
testcase_06 AC 49 ms
49,280 KB
testcase_07 AC 48 ms
49,192 KB
testcase_08 AC 48 ms
49,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int a = sc.nextInt();
        int b = sc.nextInt();
        StringBuilder sb = new StringBuilder();
        sb.append(a / b).append(".");
        a %= b;
        for (int i = 0; i < 50; i++) {
            a *= 10;
            sb.append(a / b);
            a %= b;
        }
        System.out.println(sb);
    }
}
    
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}
0