Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion caucsejunseo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
| 3์ฐจ์‹œ | 2025.03.26 | ์Šคํƒ | [์ข‹์€๋‹จ์–ด](https://www.acmicpc.net/problem/3986)|[#12]https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/12|
| 4์ฐจ์‹œ | 2025.03.27 | ์Šคํƒ | [๊ณผ์ œ๋Š”๋๋‚˜์ง€์•Š์•„!](https://www.acmicpc.net/problem/17952)|[#14]https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/14|
| 5์ฐจ์‹œ | 2025.04.02 | ํ | [์š”์„ธํ‘ธ์Šค๋ฌธ์ œ](https://www.acmicpc.net/problem/1158)|[#19]https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/19|
| 6์ฐจ์‹œ | 2025.04.06 | ํ | [์•ต๋ฌด์ƒˆ](https://www.acmicpc.net/problem/14713)|[#23]https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/23|
| 6์ฐจ์‹œ | 2025.04.06 | ํ | [์•ต๋ฌด์ƒˆ](https://www.acmicpc.net/problem/14713)|[#23]https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/23|
| 7์ฐจ์‹œ | 2025.04.10 | ๊ทธ๋ฆฌ๋”” | [ํด๋ฆฌ์˜ค๋ฏธ๋…ธ](https://www.acmicpc.net/problem/1343)|[#28]|
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;
}