結果
問題 |
No.858 わり算
|
ユーザー |
![]() |
提出日時 | 2021-04-18 22:41:51 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 643 bytes |
コンパイル時間 | 827 ms |
コンパイル使用メモリ | 110,128 KB |
実行使用メモリ | 24,208 KB |
最終ジャッジ日時 | 2024-07-04 04:51:59 |
合計ジャッジ時間 | 1,475 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 6 WA * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System.Collections.Generic; using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var a = int.Parse(line[0]); var b = int.Parse(line[1]); getAns(a, b); } static void getAns (int a, int b) { var t = a / b; a %= b; var ans = new List<int>(); for (int i = 0; i < 50; i++) { a *= 10; var w = a / b; ans.Add(w); a -= (w) * b; } Console.Write(t); Console.Write("."); Console.WriteLine(string.Join("",ans)); } }