結果

問題 No.293 4>7の世界
ユーザー takatowin
提出日時 2017-01-09 15:11:20
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 20,992 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-18 00:18:13
合計ジャッジ時間 1,087 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 11 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |   scanf("%s %s",s,t);
      |   ^~~~~~~~~~~~~~~~~~

ソースコード

diff #

#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;
        }
      }
    }
  }
  puts(t);
  end:
  num=1;
  return 0;
}

0