-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path445.cpp
More file actions
29 lines (29 loc) · 772 Bytes
/
445.cpp
File metadata and controls
29 lines (29 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <bits/stdc++.h>
int main() {
char a[135];
int i, j, k, l, flag, x;
while (gets(a)) {
if (a[0] == '\n') {
puts("");
continue;
}
l = strlen(a);
flag = 0;
for (i = 0; i < l; i++) {
if (a[i] >= '0' && a[i] <= '9')
flag += a[i] - '0';
else if (a[i] == 'b') {
for (j = 0; j < flag; j++) printf(" ");
flag = 0;
} else if (a[i] >= 'A' && a[i] <= 'Z' || a[i] == '*') {
for (j = 0; j < flag; j++) printf("%c", a[i]);
flag = 0;
} else if (a[i] == '!') {
puts("");
flag = 0;
}
}
puts("");
}
return 0;
}