結果

問題 No.293 4>7の世界
ユーザー yamaken1343yamaken1343
提出日時 2015-11-10 21:35:17
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 530 bytes
コンパイル時間 921 ms
コンパイル使用メモリ 24,044 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-11 15:33:52
合計ジャッジ時間 1,166 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,348 KB
testcase_01 AC 0 ms
4,348 KB
testcase_02 AC 0 ms
4,348 KB
testcase_03 AC 0 ms
4,348 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,352 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 0 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 0 ms
4,352 KB
testcase_10 AC 0 ms
4,352 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 0 ms
4,352 KB
testcase_16 AC 1 ms
4,352 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 0 ms
4,348 KB
testcase_19 AC 1 ms
4,352 KB
testcase_20 AC 0 ms
4,348 KB
testcase_21 AC 0 ms
4,352 KB
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 0 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(void){
	char a[16], b[16];
	char *ans;
	int i=0;
	
	scanf("%s%s",a,b);
	
	if(strlen(a) > strlen(b)) ans = a;
	else if(strlen(a) < strlen(b)) ans = b;
	else{
		while(1){
			if(a[i] != b[i]){
				if(a[i] =='7' && b[i] == '4'){
					ans = b;
					break;
				}else if(a[i] =='4' && b[i] == '7'){
					ans = b;
					break;
				}else if(a[i] > b[i]){
					ans = a;
					break;
				}else if(a[i] < b[i]){
					ans = b;
					break;
				}
			}
			i++;
		}
	}
	printf("%s\n",ans);
	return 0;
}
0