-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path444.cpp
More file actions
36 lines (35 loc) · 921 Bytes
/
444.cpp
File metadata and controls
36 lines (35 loc) · 921 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
36
#include <bits/stdc++.h>
int main() {
char a[1000], b[1000];
int i, j, l, k;
while (gets(a)) {
if (a[0] >= '0' && a[0] <= '9') {
j = 0;
l = 0;
k = strlen(a);
for (i = k - 1; i >= 0; i--) {
j = j * 10 + a[i] - 48;
if (j > 64 || j == 32 || j == 33 || j == 44 || j == 46 || j == 58 || j == 59 || j == 63) {
b[l] = j;
l++;
j = 0;
}
}
b[l] = '\0';
} else {
l = 0;
k = strlen(a);
for (i = k - 1; i >= 0; i--) {
j = a[i];
while (j > 0) {
b[l] = j % 10 + 48;
j = j / 10;
l++;
}
}
b[l] = '\0';
}
printf("%s\n", b);
}
return 0;
}