結果

問題 No.858 わり算
ユーザー shigeki_create
提出日時 2019-08-15 02:56:00
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 485 bytes
コンパイル時間 2,371 ms
コンパイル使用メモリ 76,804 KB
実行使用メモリ 41,556 KB
最終ジャッジ日時 2024-09-19 14:46:22
合計ジャッジ時間 4,148 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 WA * 5
権限があれば一括ダウンロードができます

ソースコード

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();

		print(A/B + ".");

		A = A - A/B*B;

		for(int i=0; i<50; i++) {
			while(A < B && A!=0) A = A<B ? A*10 : A;
			int result = 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