結果
| 問題 |
No.138 化石のバージョン
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-21 09:53:06 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 486 bytes |
| コンパイル時間 | 1,608 ms |
| コンパイル使用メモリ | 156,616 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 03:28:08 |
| 合計ジャッジ時間 | 2,338 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 18 |
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:10:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d.%d.%d",&A,&B,&C); //化石バージョンの入力
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
main.cpp:11:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d.%d.%d",&D,&E,&F); //判定したいバージョン
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv)
{
int A,B,C; //化石バージョン
int D,E,F; //判定したいバージョン
scanf("%d.%d.%d",&A,&B,&C); //化石バージョンの入力
scanf("%d.%d.%d",&D,&E,&F); //判定したいバージョン
//バージョンの判定
if((A == D) && (B == E) && (C > F))
{
printf("YES\n");
}
else if(A<D)
{
printf("NO\n");
}
else
{
printf("NO\n");
}
return 0;
}