結果

問題 No.46 はじめのn歩
ユーザー Mrjuelmeat
提出日時 2018-07-21 21:55:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 304 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 22,400 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 05:03:39
合計ジャッジ時間 778 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:11: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |      scanf("%d",&step);
      |      ~~~~~^~~~~~~~~~~~
main.cpp:11:11: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |      scanf("%d",&distance);
      |      ~~~~~^~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>

int main (void)
{
    int step;
    int distance;
    int anser;
    //double ans_cmp;
    
     scanf("%d",&step);
     scanf("%d",&distance);
     
     anser = distance / step;
    if( distance % step != 0 )
    {
    	anser++;
    }
    
    printf("%d",anser);
    
   return 0;
}
0