結果
問題 | No.138 化石のバージョン |
ユーザー |
|
提出日時 | 2017-08-25 11:03:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 641 ms |
コンパイル使用メモリ | 53,980 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 14:31:01 |
合計ジャッジ時間 | 1,437 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d.%d.%d", a, a + 1, a + 2); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d.%d.%d", b, b + 1, b + 2); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream> using namespace std; int main() { int a[3], b[3]; scanf("%d.%d.%d", a, a + 1, a + 2); scanf("%d.%d.%d", b, b + 1, b + 2); for (int i = 0; i < 3; i++) { if (a[i] < b[i]) { cout << "NO" << endl; return 0; } else if (a[i] > b[i]) { cout << "YES" << endl; return 0; } } cout << "YES" << endl; return 0; }