結果

問題 No.293 4>7の世界
コンテスト
ユーザー takatowin
提出日時 2017-01-09 15:20:51
言語 C90(gcc15)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 780 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 181 ms
コンパイル使用メモリ 38,344 KB
最終ジャッジ日時 2026-02-24 00:04:42
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 13 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>
#include<string.h>
int main(void){
  char s[11],t[11];
  int num,i;
  scanf("%s %s",s,t);
  if(strlen(s)>strlen(t))
    puts(s);
  else if(strlen(t)>strlen(s))
    puts(t);
  else{
    for(i=0;i<strlen(s);i++){
      if(s[i]>t[i]){
        if(!(s[i]=='7' && t[i]=='4')){
          puts(s);
          goto end;
        }
        else{
          puts(t);
          goto end;
        }
      }else if(s[i]=='4' && t[i]=='7'){
        puts(s);
        goto end;
      }else if(t[i]>s[i]){
        if(!(t[i]=='7' && s[i]=='4')){
          puts(t);
          goto end;
        }else{
          puts(s);
          goto end;
        }
      }else if(t[i]=='4' && s[i]=='7'){
        puts(t);
        goto end;
      }
    }
  }
  puts(t);
  end:
  num=1;
  return 0;
}

0