結果

問題 No.222 引き算と足し算
ユーザー hogeover30hogeover30
提出日時 2015-10-31 00:13:31
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 141 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 24,092 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 17:48:51
合計ジャッジ時間 1,093 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,816 KB
testcase_01 AC 0 ms
6,940 KB
testcase_02 WA -
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 0 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 0 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 0 ms
6,944 KB
testcase_15 AC 1 ms
6,940 KB
testcase_16 AC 0 ms
6,940 KB
testcase_17 AC 0 ms
6,944 KB
testcase_18 AC 1 ms
6,940 KB
testcase_19 AC 1 ms
6,940 KB
testcase_20 AC 1 ms
6,940 KB
testcase_21 AC 1 ms
6,944 KB
testcase_22 AC 0 ms
6,940 KB
testcase_23 AC 0 ms
6,944 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 0 ms
6,944 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 0 ms
6,940 KB
testcase_30 AC 1 ms
6,944 KB
testcase_31 AC 1 ms
6,944 KB
testcase_32 WA -
testcase_33 AC 0 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%d%[+-]%d", &x, op, &y);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
int main()
{
    int x, y;
    char op[2];
    scanf("%d%[+-]%d", &x, op, &y);
    printf("%d\n", *op=='+' ? x-y : x+y);
}
0