結果
| 問題 |
No.293 4>7の世界
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-24 14:43:08 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 836 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 29,312 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 14:18:34 |
| 合計ジャッジ時間 | 903 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 10 WA * 5 RE * 5 |
ソースコード
#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;
}