結果

問題 No.46 はじめのn歩
ユーザー ayanamizutaayanamizuta
提出日時 2017-06-30 17:12:22
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 139 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 22,144 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 05:45:42
合計ジャッジ時間 2,269 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:10: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int’ [-Wformat=]
    4 |  scanf("%d %d",a,b);
      |         ~^     ~
      |          |     |
      |          int*  int
main.cpp:4:13: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘int’ [-Wformat=]
    4 |  scanf("%d %d",a,b);
      |            ~^    ~
      |             |    |
      |             int* int
main.cpp:4:7: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |  scanf("%d %d",a,b);
      |  ~~~~~^~~~~~~~~~~~~
main.cpp:4:7: warning: ‘a’ is used uninitialized [-Wuninitialized]
    4 |  scanf("%d %d",a,b);
      |  ~~~~~^~~~~~~~~~~~~
main.cpp:4:7: warning: ‘b’ is used uninitialized [-Wuninitialized]

ソースコード

diff #

#include <stdio.h>
int main(){
 int a,b;
 scanf("%d %d",a,b);
 if(b % a == 0)
  printf("%d",b/a);
 else
  printf("%d",b/a +1);
 return 0;
}
0