結果

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

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main() {

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

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

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

	while (str1[u] != 4 || str1[u] != 7 || str1[u] != '\0') {

		u++;
	}
	if (str1[u] == 4 || str1[u] == 7) {
		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);
			}
		}
	}
	else {

		if (j == r) {
			for (int y = 0; str1[y] != '\0'; y++) {
				if (str1[y] < str2[y]) {
					printf("%s", str2);
				}
				else {
					printf("%s", str1);
				}
			}
		}
	}

	return 0;
}
0