結果
問題 | No.858 わり算 |
ユーザー |
![]() |
提出日時 | 2019-08-10 17:05:18 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 645 bytes |
コンパイル時間 | 141 ms |
コンパイル使用メモリ | 27,520 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-07 14:50:27 |
合計ジャッジ時間 | 890 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:20:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 20 | scanf("%lld %lld", &a, &b); | ^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> #include <math.h> #include <limits.h> #define Max(a, b) ((a) > (b) ? (a) : (b)) #define Min(a, b) ((a) > (b) ? (b) : (a)) #define abs(x) ((x) > 0 ? (x) : -(x)) #define rep(i, n) for(int i = 0; i < (n); i++) #define MOD 1000000007 //10^9 + 7 #define endl printf("\n") typedef long long ll; #define MAX_N (1 << 17) int main(int argc, char *argv[]) { ll a, b, d; scanf("%lld %lld", &a, &b); printf("%lld.", a / b); ll x = (a % b) * 10; for (int i = 0; i < 50; i++) { d = x / b; printf("%lld", d); x = (x - d * b) * 10; } endl; return 0; }