#include <stdio.h>
#include <ctype.h>
#include <string.h>
void remove_extra_spaces(char *s) {
char *p;
while ((p = strstr(s, " "))) {
strcpy(p, p + 1);
}
if (s[0] == ' ') strcpy(s, s + 1);
if (s[strlen(s) - 1] == ' ') s[strlen(s) - 1] = '\0';
}
int main(void) {
char s[] = "php \r\n javascript nodejs \r\n c \t\t c++ python \r\n c#\n";
char *p = s;
while (*p) {
if ((*p == '\t') || (*p == '\r') || (*p == '\n')) {
*p = ' ';
}
p++;
}
remove_extra_spaces(s);
puts(s);
return 0;
}
/*
run:
php javascript nodejs c c++ python c#
*/