結果
| 問題 |
No.138 化石のバージョン
|
| コンテスト | |
| ユーザー |
michonz4
|
| 提出日時 | 2019-05-28 19:50:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 505 bytes |
| コンパイル時間 | 440 ms |
| コンパイル使用メモリ | 53,720 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-17 15:49:23 |
| 合計ジャッジ時間 | 1,450 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d.%d.%d", &a1, &b1, &c1);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:8:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d.%d.%d", &a2, &b2, &c2);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>
using namespace std;
int main() {
int a1, b1, c1, a2, b2, c2, a, b;
scanf("%d.%d.%d", &a1, &b1, &c1);
scanf("%d.%d.%d", &a2, &b2, &c2);
if (a1>a2) {
cout << "YES" << endl;
} else if (a1<a2) {
cout << "NO" << endl;
} else {
if (b1>b2) {
cout << "YES" << endl;
} else if (b1<b2) {
cout << "NO" << endl;
} else {
if (c1<c2) {
cout << "NO" << endl;
} else {
cout << "YES" << endl;
}
}
}
return 0;
}
michonz4