36 lines
619 B
C
36 lines
619 B
C
#include <ctype.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main(int argc, char **argv) {
|
|
for(argc -= 1, argv += 1; *argv; argc -= 1, argv += 1) {
|
|
char *idx = *argv;
|
|
char *begin = NULL;
|
|
char *end = NULL;
|
|
|
|
for(; *idx; idx += 1) {
|
|
if(isalpha(*idx)) {
|
|
if(!begin) {
|
|
begin = idx;
|
|
}
|
|
|
|
end = idx;
|
|
} else {
|
|
for(; end && end >= begin; end -= 1) {
|
|
fputc(*end, stdout);
|
|
}
|
|
|
|
if(begin) {
|
|
begin = NULL;
|
|
end = NULL;
|
|
}
|
|
|
|
fputc(*idx, stdout);
|
|
}
|
|
}
|
|
|
|
fputc('\n', stdout);
|
|
}
|
|
|
|
return 0;
|
|
}
|