結果

問題 No.46 はじめのn歩
ユーザー jolly_gliscor
提出日時 2018-02-19 19:33:54
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 273 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 23,552 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-08 12:26:56
合計ジャッジ時間 3,025 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int CountWalk(int, int)’:
main.cpp:12:1: warning: no return statement in function returning non-void [-Wreturn-type]
   12 | }
      | ^
main.cpp: In function ‘int main(int, char**)’:
main.cpp:17:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |   scanf("%d",&a);
      |   ~~~~~^~~~~~~~~
main.cpp:18:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   18 |   scanf("%d",&b);
      |   ~~~~~^~~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <cstdlib>

int CountWalk(int a, int b)
{
  for(int i=1;;i++){
    if ( b <= a*i ){
      printf("%d\n",i);
      break;
    }
  }
}

int main(int argc, char **argv)
{
  int a,b;
  scanf("%d",&a);
  scanf("%d",&b);
  CountWalk(a,b);
  return 0;
}
0