結果
問題 |
No.293 4>7の世界
|
ユーザー |
![]() |
提出日時 | 2017-01-09 15:13:06 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 532 bytes |
コンパイル時間 | 103 ms |
コンパイル使用メモリ | 20,864 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-18 00:18:17 |
合計ジャッジ時間 | 827 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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); | ^~~~~~~~~~~~~~~~~~
ソースコード
#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; } } } puts(t); end: num=1; return 0; }