結果
| 問題 |
No.138 化石のバージョン
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-31 15:49:21 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 318 bytes |
| コンパイル時間 | 842 ms |
| コンパイル使用メモリ | 54,584 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 12:59:35 |
| 合計ジャッジ時間 | 1,276 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
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",&A[0],&A[1],&A[2]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d.%d.%d",&B[0],&B[1],&B[2]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>
using namespace std;
int main() {
int A[3], B[3];
scanf("%d.%d.%d",&A[0],&A[1],&A[2]);
scanf("%d.%d.%d",&B[0],&B[1],&B[2]);
int valA = A[0]*10000 + A[1]*100 + A[2];
int valB = B[0]*10000 + B[1]*100 + B[2];
if(valA < valB)
cout << "NO" << endl;
else
cout << "YES" << endl;
return 0;
}