結果

問題 No.46 はじめのn歩
ユーザー pazudorateapazudoratea
提出日時 2016-08-27 16:50:32
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 20,224 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 06:27:16
合計ジャッジ時間 670 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,812 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 0 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |     ^~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>  // scanfとprintfを使うおまじない

int main(int argc, char *argv[]){
    int A, B;

    // 標準入力から読み込む(空白や改行で勝手に区切ってくれる)
    // 逆に空白込みの文字列を読み込む場合は別の方法で読む必要がある。
    scanf("%d%d%s", &A, &B);

    // 標準出力に出力

    printf("%d\n", B % A + 1);

    return 0;
}
0