-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11541.cpp
More file actions
35 lines (34 loc) · 909 Bytes
/
11541.cpp
File metadata and controls
35 lines (34 loc) · 909 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
30
31
32
33
34
35
#include <bits/stdc++.h>
int main() {
char a[201], b[201];
long long n;
int i, t, j, l, k, m;
scanf("%d", &t);
getchar();
for (k = 1; k <= t; k++) {
gets(a);
l = strlen(a);
j = 0;
n = 0;
printf("Case %d: ", k);
for (i = 0; i < l; i++) {
if (a[i] >= 'A' && a[i] <= 'Z') {
b[j] = a[i];
j++;
} else if (a[i] >= '0' && a[i] <= '9') {
n = (n * 10) + a[i] - 48;
}
if ((a[i] >= '0' && a[i] <= '9' && a[i + 1] >= 'A' && a[i + 1] <= 'Z') ||
(a[i] >= '0' && a[i] <= '9' && a[i + 1] == '\0')) {
b[j] = '\0';
for (m = 0; m < n; m++) {
printf("%s", b);
}
j = 0;
n = 0;
}
}
printf("\n");
}
return 0;
}