From babf310bfeeedaec3847ae9479678e3d5e661a52 Mon Sep 17 00:00:00 2001 From: cho4u4o <128016678+cho4u4o@users.noreply.github.com> Date: Thu, 1 Jun 2023 15:03:27 +0900 Subject: [PATCH] =?UTF-8?q?[5=EC=A3=BC=EC=B0=A8]=20=ED=95=9C=EC=9C=A0?= =?UTF-8?q?=EC=A7=84=20=EA=B3=BC=EC=A0=9C=EC=A0=9C=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3문제 중에 하나만 성공해서 일단 하나만 제출하게 되었습니다.. --- Week5_1475.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Week5_1475.c diff --git a/Week5_1475.c b/Week5_1475.c new file mode 100644 index 0000000..51c4b41 --- /dev/null +++ b/Week5_1475.c @@ -0,0 +1,26 @@ +#include + +int main() { + char str[8]; + int ovrl[10] = {0}; + + scanf("%s", str); + + for (int i = 0; str[i] != '\0'; i++) { + ovrl[str[i] - '0']++; + } + + int sixNineCount = ovrl[6] + ovrl[9]; + ovrl[6] = ovrl[9] = (sixNineCount + 1) / 2; + + int setCount = 0; + for (int i = 0; i < 10; i++) { + if (ovrl[i] > setCount) { + setCount = ovrl[i]; + } + } + + printf("%d", setCount); + + return 0; +} \ No newline at end of file