結果

問題 No.138 化石のバージョン
ユーザー Yut176
提出日時 2016-09-05 16:20:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 65,184 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-15 20:28:16
合計ジャッジ時間 1,637 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |   scanf("%d.%d.%d\n", &a[0], &a[1], &a[2]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:17:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |   scanf("%d.%d.%d", &b[0], &b[1], &b[2]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include<vector>
#include<string>
#include<sstream>
#include<math.h>
using namespace std;


int main(){

  int a[3];
  int b[3];
  scanf("%d.%d.%d\n", &a[0], &a[1], &a[2]);
  scanf("%d.%d.%d", &b[0], &b[1], &b[2]);

  for(int i=0; i<3; i++){
    if( a[i] < b[i] ){
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;

  return 0;
}
0