#include <stdio.h>
#include <ctype.h>
/*
每次读取一个字符及其之后的字符,若其之后的字符不是'-',则直接输出当前字符并更新当前字符以及其之后的字符
若其之后的字符是'-',则更新其之后的字符并将二者传入展开函数中输出
然后更新当前字符,并重复上述过程,直到之后的字符为'\n'
最后输出当前字符即可
*/
void strch(char a, char b, int p1, int p2, int p3);
int main(void)
{
char pre, next;
int p1, p2, p3;
scanf_s("%d %d %d", &p1, &p2, &p3);
getchar();//清除行末的'\n'
pre = getchar();
next = getchar();
while (next != '\n')
{
if (next == '-')
{
next = getchar();
strch(pre, next, p1, p2, p3);
}
else
{
putchar(pre);
}
pre = next;
if (pre == '\n')
break;
next = getchar();
}
putchar(pre);
return 0;
}
void strch(char a, char b, int p1, int p2, int p3)
{
if (!(isalpha(a) && isalpha(b)) && !(isdigit(a) && isdigit(b)))
{
printf("%c-", a);
}
else if (a >= b)
{
printf("%c-", a);
}
else if (b == a + 1)
{
printf("%c", a);
}
else
{
putchar(a);
for (int i = 1; i < b - a; i++)
{
switch (p3)
{
case 1:
for (int j = 1; j <= p2; j++)
{
switch (p1)
{
case 1:
putchar(tolower(a + i));
break;
case 2:
putchar(toupper(a + i));
break;
default:
putchar('*');
}
}
break;
case 2:
for (int j = 1; j <= p2; j++)
{
switch (p1)
{
case 1:
putchar(tolower(b - i));
break;
case 2:
putchar(toupper(b - i));
break;
default:
putchar('*');
}
}
}
}
}
}