結果

問題 No.208 王将
ユーザー a
提出日時 2015-05-15 22:57:58
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 242 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 22,528 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 04:12:55
合計ジャッジ時間 885 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |   int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d);
      |                ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>

using namespace std;

int main(void)
{
  int a,b,c,d; scanf("%d%d%d%d",&a,&b,&c,&d);
  int res = 0;
  if( a == b && c == d ) {
    res = a+1;
  } else {
    if(a<b)res=b; else res=a;
  }
  printf("%d\n",res);
  return 0;
}
0