結果

問題 No.293 4>7の世界
ユーザー Reita HagiharaReita Hagihara
提出日時 2017-08-24 14:02:10
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 521 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 28,928 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-23 14:10:12
合計ジャッジ時間 790 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main() {

	char str1[11], str2[11];
	int i;
	int j, r;

	scanf("%s%s", &str1, &str2);

	for (j = 0; str1[j] != '\0'; j++) {}
	for (r = 0; str2[r] != '\0'; r++) {}

	if (j == r) {
		for (i = 0; str1[i] != '\0'; i++) {
			if (str1[i] == '4' && str2[i] == '7') {
				printf("%s", str1);
				break;
			}
			else if (str1[i] == '7' && str2[i] == '4') {
				printf("%s", str2);
				break;
			}
		}
	}
	else {
		if (j > r) {
			printf("%s", str1);
		}
		else {
			printf("%s", str2);
		}
	}

	return 0;
}
0