Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions caucsejunseo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
| 6์ฐจ์‹œ | 2025.04.06 | ํ | [์•ต๋ฌด์ƒˆ](https://www.acmicpc.net/problem/14713)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/23|
| 7์ฐจ์‹œ | 2025.04.10 | ๊ทธ๋ฆฌ๋”” | [ํด๋ฆฌ์˜ค๋ฏธ๋…ธ](https://www.acmicpc.net/problem/1343)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/28|
| 8์ฐจ์‹œ | 2025.04.11 | ์—ฐ๊ฒฐ๋ฆฌ์ŠคํŠธ| [ํ‚ค๋กœ๊ฑฐ](https://www.acmicpc.net/problem/5397)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/30|

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include <string.h>

#define MAX 51
#define OUTPUT_MAX 500

int main()
{
char str[MAX];
scanf("%s", str);

char div[MAX] = { 0 };
char result[OUTPUT_MAX] = { 0 }; // ๊ฒฐ๊ณผ ์ €์žฅ์šฉ
int res_index = 0;
int i = 0, j = 0;
int len1 = strlen(str);

for (i = 0; i <= len1; i++)
{
if (str[i] == '.' || str[i] == '\0')
{
int len2 = strlen(div);

if (len2 % 2 != 0) {
printf("-1\n");
return 0; // ์ค‘๊ฐ„์— ์˜ค๋ฅ˜ ๋ฐœ์ƒ ์‹œ ์ฆ‰์‹œ ์ข…๋ฃŒ
}

for (int k = 0; k < len2 / 4; k++)
strcat(result, "AAAA");
for (int k = 0; k < (len2 % 4) / 2; k++)
strcat(result, "BB");

if (str[i] == '.')
strcat(result, ".");

memset(div, 0, sizeof(div));
j = 0;
}
else
{
div[j++] = str[i];
}
}

printf("%s\n", result); // ๋ชจ๋“  ๊ตฌ๊ฐ„ ์ฒ˜๋ฆฌ ํ›„ ์ถœ๋ ฅ

return 0;
}