結果

問題 No.383 レーティング
ユーザー nisshimo
提出日時 2019-01-19 11:28:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 22,144 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-08 14:06:18
合計ジャッジ時間 957 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |     scanf("%d", &a);
      |     ~~~~~^~~~~~~~~~
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d", &b);
      |     ~~~~~^~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
using namespace std;

int main(void)
{
    int a, b, diff;
    scanf("%d", &a);
    scanf("%d", &b);
    diff= b - a;
    if (diff <= 0)
    {
        printf("%d", diff);
    }
    else
    {
        printf("%1s%d", "+", diff);
    }
    return 0;
}
0