結果

問題 No.858 わり算
ユーザー Y17Y17
提出日時 2019-08-09 21:41:44
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 1,340 ms
コンパイル使用メモリ 161,524 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-07 14:49:03
合計ジャッジ時間 1,882 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(){
    int a, b;
    cin >> a >> b;
    int up = a / b;
    int now = a % b;

    queue<int> que;
    for(int i = 0;i < 50;i++){
        now *= 10;
        que.push(now / b);
        now = now % b;
    }

    cout << up << ".";

    while(!que.empty()){
        cout << que.front();
        que.pop();
    }

    cout << endl;

    return 0;
}
0