結果

問題 No.858 わり算
ユーザー shidoro_onnshidoro_onn
提出日時 2019-08-25 16:15:59
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 464 ms
コンパイル使用メモリ 28,544 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 10:59:19
合計ジャッジ時間 966 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(void){
    
    int a=0;
    int b=0;
    scanf("%d%d",&a,&b);
    
    /*
    3/7のとき
    3/7 = 0あまり3
    30/7 = 4あまり2
    20/7 = 2あまり6
    60/7 = 8あまり4
    */
    
    int i=0;
    int tmp = a;
    
    for(i=0;i<51;i++){
        printf("%d",tmp/b);
        
        if(i==0) printf(".");
        
        tmp = tmp%b*10;
    }
    
}
0