Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdbool.h>
- #include <stdio.h>
- #include <math.h>
- #include <string.h>
- #include <ctype.h>
- void main()
- {
- char str[200];
- fgets(str, 200, stdin);
- strtok(str, "\n");
- int spcCount = 0;
- for (int i = 0; i < strlen(str); i++)
- {
- if ((str[i] >= 'A' && str[i] <= 'Z') || (str[i] >= 'a' && str[i] <= 'z')) {
- printf("%c", str[i]);
- spcCount = 0;
- }
- if (str[i] == ' ' && spcCount == 0) {
- printf(" ");
- spcCount++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement