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