結果
| 問題 | No.858 わり算 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-10 09:18:37 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 427 bytes |
| 記録 | |
| コンパイル時間 | 604 ms |
| コンパイル使用メモリ | 65,000 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-19 16:59:38 |
| 合計ジャッジ時間 | 1,278 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 1 RE * 1 |
ソースコード
#include <iostream>
#include <string>
#include <string.h>
#include <stdlib.h>
using namespace std;
int main(int argc, char* argv[])
{
string S;
char tmp[10];
int A,B,C,D;
cin>>A>>B;
int i=0;
bool bDot=true;
while (i<51){
C=A/B;
D=A%B;
if (C>0){
sprintf(tmp,"%d",C);
S+=tmp;
}else{
S+="0";
}
if (bDot){
S+=".";
bDot=false;
}
A=10*D;
if (!bDot){
i++;
}
}
cout<<S<<endl;
return 0;
}