Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- char str[255];
- int count = 0, i, id, max = 0;
- printf("Insert: ");
- gets_s(str);
- for (i = 0; i < strlen(str) - 1; i++) {
- if (str[i] != ' ') count += 1;
- else {
- if (count > max) {
- max = count;
- id = i - count;
- }
- count = 0;
- }
- }
- max += id;
- for (i = id; i < max; i++) putchar(str[i]);
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement