Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- void main()
- {
- int i;
- char ten[31];
- gets_s(ten);
- while (ten[0] == ' ') for (i = 0; i < strlen(ten); i++) ten[i] = ten[i + 1];
- while (ten[strlen(ten) - 1] == ' ') ten[strlen(ten) - 1] = '\0';
- for (i = 0; i < strlen(ten); i++) if (ten[i] == ' ') while (ten[i + 1] == ' ') for (int j = i; j < strlen(ten); j++) ten[j] = ten[j + 1];
- puts(ten);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement