結果
| 問題 | 
                            No.138 化石のバージョン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2017-07-21 09:52:10 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 451 bytes | 
| コンパイル時間 | 1,480 ms | 
| コンパイル使用メモリ | 156,764 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-09 03:27:58 | 
| 合計ジャッジ時間 | 2,823 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 11 WA * 22 | 
コンパイルメッセージ
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");
  }
return 0;
}