結果

問題 No.138 化石のバージョン
ユーザー FVRChan
提出日時 2017-09-29 09:11:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 535 bytes
コンパイル時間 527 ms
コンパイル使用メモリ 65,460 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-15 19:45:55
合計ジャッジ時間 1,626 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 WA * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%d.%d.%d",&a,&b,&c);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%d.%d.%d",&aa,&bb,&cc);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<iostream>
#include<queue>
#include<cstdio>
#include<utility>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
	int a,b,c,aa,bb,cc;
	scanf("%d.%d.%d",&a,&b,&c);
	scanf("%d.%d.%d",&aa,&bb,&cc);
	if(aa<a){
		cout<<"YES"<<endl;
		return 0;
	}else if(aa>a){
		cout<<"NO"<<endl;
		return 0;
	}else if(bb>b){
		cout<<"YES"<<endl;
		return 0;
	}else if(bb<b){
		cout<<"NO"<<endl;
		return 0;
	}else if(cc<c){
		cout<<"YES"<<endl;
		return 0;
	}else if(cc>c){
		cout<<"NO"<<endl;
		return 0;
	}cout<<"YES"<<endl;
}
0