結果

問題 No.138 化石のバージョン
ユーザー Kura
提出日時 2019-02-22 19:07:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 263 bytes
コンパイル時間 739 ms
コンパイル使用メモリ 54,036 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-24 22:37:04
合計ジャッジ時間 1,931 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |         scanf("%d.%d.%d", &a, &b, &c);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d.%d.%d", &d, &e, &f);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int main() {
	int a, b, c, d, e, f;
	scanf("%d.%d.%d", &a, &b, &c);
	scanf("%d.%d.%d", &d, &e, &f);
	if (a * 10201 + b * 101 + c >= d * 10201 + e * 101 + f) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}
0