結果

問題 No.138 化石のバージョン
ユーザー 184
提出日時 2015-01-29 23:27:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 374 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 34,160 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-23 04:07:34
合計ジャッジ時間 1,165 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29 WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:28: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         int a[3],b[3];scanf("%d.%d.%d%d.%d.%d",&a[0],&a[1],&a[2],&b[0],&b[1],&b[2]);
      |                       ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <cstdlib> 
#include <algorithm>
 
using namespace std;

//namaega184


int main(){
	int a[3],b[3];scanf("%d.%d.%d%d.%d.%d",&a[0],&a[1],&a[2],&b[0],&b[1],&b[2]);
	for(int i=0;i<3;i++){
		if(a[i]<b[i]){
			printf("NO\n");
			return 0;
		}
		else if(a[i]>b[i]){
			printf("YES\n");
			return 0;
		}
	}
	printf("NO\n");
	return 0;
}
0