結果
問題 |
No.293 4>7の世界
|
ユーザー |
|
提出日時 | 2016-06-08 14:24:08 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 577 bytes |
コンパイル時間 | 267 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-09 03:01:29 |
合計ジャッジ時間 | 1,179 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 18 WA * 2 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%s %s",A,B); | ^~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> int main(){ char A[15],B[15]; int i,j; scanf("%s %s",A,B); i = strlen(A); j = strlen(B); if(i>j){ printf("%s\n",A); return 0; } else if(j>i){ printf("%s\n",A); return 0; } for(i=0;;i++){ if((A[i]=='4')&&(B[i]=='7')){ printf("%s\n",A); return 0; } else if((A[i]=='7')&&(B[i]=='4')){ printf("%s\n",B); return 0; } else if(A[i]>B[i]){ printf("%s\n",A); return 0; } else if (A[i]<B[i]){ printf("%s\n",B); return 0; } } }