結果

問題 No.138 化石のバージョン
コンテスト
ユーザー nari11111
提出日時 2015-01-29 23:39:06
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 0 ms / 5,000 ms
+ 686µs
コード長 453 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 150 ms
コンパイル使用メモリ 28,800 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-23 20:50:55
合計ジャッジ時間 1,983 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |     scanf("%i.%i.%i",&ka,&kb,&kc);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:12:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |     scanf("%i.%i.%i",&a,&b,&c);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{

    int ka,kb,kc;
    scanf("%i.%i.%i",&ka,&kb,&kc);

    int a,b,c;
    scanf("%i.%i.%i",&a,&b,&c);

    char ans[256] = "NO";

    if (ka>a)
        strcpy(ans, "YES");
    else if(ka==a) {
        if (kb>b)
            strcpy(ans, "YES");
        else if(kb==b){
            if (kc>=c)
                strcpy(ans, "YES");
        }
    }

    printf("%s",ans);
    return 0;
}
0