結果

問題 No.780 オフ会
ユーザー hirotakashin040
提出日時 2019-02-09 13:06:30
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 421 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 63,468 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-01 18:38:54
合計ジャッジ時間 1,433 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:18:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   18 |         scanf("%d",&B);
      |         ~~~~~^~~~~~~~~
main.cpp:20:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |         scanf("%d",&G);
      |         ~~~~~^~~~~~~~~

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<cstring>
#include<algorithm>
#include<stdio.h>
#include<cmath>

using namespace std;

int main()
{
	int B;
	int G;

	cout<<"ヤスオ君を除いた男女の数を入力"<<endl;
	cout<<"男"<<endl;
	scanf("%d",&B);
	cout<<"女"<<endl;
	scanf("%d",&G);

	if(B+1 == G)
	{
		cout<<"YES"<<endl;
	}

	else
	{
		cout<<"NO"<<endl;
	}

	cout<<abs((B+1)-G)<<endl;

}

0