Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- char *trim( char *a )
- {
- int i, j, szamlalo=0, x=0;
- char *masolat;
- char *hol;
- char b[]=" ";
- masolat = (char *) malloc(30);
- strcpy(masolat, a);
- while ((hol=strstr(masolat, b))!=0){
- if (strcpy(hol,hol+strlen(b)))
- szamlalo++;
- }
- return masolat;
- }
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- char s[ 1000 ];
- char *trim( char * );
- while ( gets( s ) != NULL )
- {
- char *p = trim( s );
- puts( p );
- free( p );
- }
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement