結果
問題 |
No.858 わり算
|
ユーザー |
|
提出日時 | 2020-03-24 14:44:29 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 224 bytes |
コンパイル時間 | 177 ms |
コンパイル使用メモリ | 28,032 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-07 14:53:34 |
合計ジャッジ時間 | 722 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:5:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] 5 | printf("%d.",A/B);r=(A%B)*10; | ~^ ~~~ | | | | int long int | %ld main.cpp:7:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] 7 | printf("%d",r/B); | ~^ ~~~ | | | | int long int | %ld main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 4 | scanf("%ld %ld",&A,&B); | ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio> int main(){ long int A,B,r; scanf("%ld %ld",&A,&B); printf("%d.",A/B);r=(A%B)*10; for(int i=0;i<50;i++){ printf("%d",r/B); r=(r%B)*10; } printf("\n"); return 0; }