Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <stdlib.h>
- #define NMAX 200
- void del(char s[], int pos) {
- for (int i = pos; s[i]; i++) {
- s[i] = s[i + 1];
- }
- }
- int main(void) {
- static char line[NMAX + 1];
- if (fgets(line, NMAX + 1, stdin) == NULL) {
- fprintf(stderr, "error!\n");
- exit(-1);
- }
- for (int i = 1; line[i]; i++) {
- int end = 0;
- for (int j = i; !end && !isalpha(line[j]); j++) {
- if (!line[j]) {
- end = 1;
- }
- }
- if (!end && !isalpha(line[i - 1]) && !isalpha(line[i])) {
- del(line, i);
- i--;
- }
- }
- puts(line);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement