結果

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

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main() {

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

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

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

	if (n != 10 && m != 10) {
		if (r == j) {
			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