You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

#include <bits/stdc++.h>
using namespace std;
void out(char c, int cnt) {
for (int i = 1; i <= cnt; i++) printf("%c", c);
}
bool check(char x, char y) {
if (isdigit(x) && isdigit(y) && x < y) return true;
if (isalpha(x) && isalpha(y) && x < y) return true;
return false;
}
int main() {
int p1, p2, p3;
string s;
cin >> p1 >> p2 >> p3 >> s;
for (int i = 0; i < s.size(); i++) {
char x = s[i - 1], y = s[i + 1];
if (s[i] == '-' && check(x, y)) {
if (p1 == 3)
for (char a = x + 1; a < y; a++) out('*', p2);
if (p1 == 1) {
if (p3 == 1)
for (char a = x + 1; a < y; a++) out(tolower(a), p2);
else
for (char a = y - 1; a > x; a--) out(tolower(a), p2);
}
if (p1 == 2) {
if (p3 == 1)
for (char a = x + 1; a < y; a++) out(toupper(a), p2);
else
for (char a = y - 1; a > x; a--) out(toupper(a), p2);
}
} else
cout << s[i];
}
return 0;
}