結果
問題 |
No.46 はじめのn歩
|
ユーザー |
![]() |
提出日時 | 2016-08-27 16:59:34 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 19:24:44 |
合計ジャッジ時間 | 663 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:8:17: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=] 8 | scanf("%d%d%s", &A, &B); | ~^ | | | char * main.c:8:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d%d%s", &A, &B); | ^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> // scanfとprintfを使うおまじない int main(int argc, char *argv[]){ int A, B, x; // 標準入力から読み込む(空白や改行で勝手に区切ってくれる) // 逆に空白込みの文字列を読み込む場合は別の方法で読む必要がある。 scanf("%d%d%s", &A, &B); // 標準出力に出力 if (B%A == 0) { x = B/A; } else{ x = B/A + 1; } printf("%d\n", x); return 0; }